summaryrefslogtreecommitdiff
path: root/gas/as.c
diff options
context:
space:
mode:
authorIain Sandoe <iain@codesourcery.com>2011-12-29 10:53:10 +0000
committerIain Sandoe <iain@codesourcery.com>2011-12-29 10:53:10 +0000
commitbcf0aac6f660e4ee754a93276a8601ab1e1bb42c (patch)
treed9073253ba036586d92e44bf9e8c7c98661be7cc /gas/as.c
parent3362e0d9fb6c0e34a2875295c34ca3f73cdf8892 (diff)
downloadbinutils-gdb-bcf0aac6f660e4ee754a93276a8601ab1e1bb42c.tar.gz
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.
Diffstat (limited to 'gas/as.c')
-rw-r--r--gas/as.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gas/as.c b/gas/as.c
index b99ea1e8be6..1325038f532 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. */