From bcf0aac6f660e4ee754a93276a8601ab1e1bb42c Mon Sep 17 00:00:00 2001 From: Iain Sandoe Date: Thu, 29 Dec 2011 10:53:10 +0000 Subject: adjust mach-o default GAS sections. gas: * as.c (perform_an_assembly_pass): Do not create text, data and bss sections for MACH-O. Do not switch to the text section. * config/obj-macho.c (obj_mach_o_segT_from_bfd_name): Forward decl. (mach_o_begin): Startup with only text section unless suppressed. * config/obj-macho.h (obj_begin): define to mach_o_begin (). gas/testsuite: * gas/mach-o/sections-1.d: Amend to recognize that bss is not emitted by default. * gas/mach-o/sections-2.d: New. --- gas/as.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gas/as.c') diff --git a/gas/as.c b/gas/as.c index b99ea1e8be..1325038f53 100644 --- a/gas/as.c +++ b/gas/as.c @@ -1037,10 +1037,13 @@ static void perform_an_assembly_pass (int argc, char ** argv) { int saw_a_file = 0; +#ifndef OBJ_MACH_O flagword applicable; +#endif need_pass_2 = 0; +#ifndef OBJ_MACH_O /* Create the standard sections, and those the assembler uses internally. */ text_section = subseg_new (TEXT_SECTION_NAME, 0); @@ -1057,12 +1060,15 @@ perform_an_assembly_pass (int argc, char ** argv) | SEC_DATA)); bfd_set_section_flags (stdoutput, bss_section, applicable & SEC_ALLOC); seg_info (bss_section)->bss = 1; +#endif subseg_new (BFD_ABS_SECTION_NAME, 0); subseg_new (BFD_UND_SECTION_NAME, 0); reg_section = subseg_new ("*GAS `reg' section*", 0); expr_section = subseg_new ("*GAS `expr' section*", 0); +#ifndef OBJ_MACH_O subseg_set (text_section, 0); +#endif /* This may add symbol table entries, which requires having an open BFD, and sections already created. */ -- cgit v1.2.3