On Mon, Jun 4, 2012 at 11:08 PM, Eric Botcazou <ebotca...@adacore.com> wrote: >> Hmm, Mach-O does have BSS. > > OK, bad memory, this was for Tru64.
Could it be that there is a bug in the way .bss section selection works? Looking through the documentation, it seems actually rather hard to miss the .bss section: @defmac BSS_SECTION_ASM_OP If defined, a C expression whose value is a string, including spacing, containing the assembler operation to identify the following data as uninitialized global data. If not defined, and @code{ASM_OUTPUT_ALIGNED_BSS} not defined, uninitialized global data will be output in the data section if @option{-fno-common} is passed, otherwise @code{ASM_OUTPUT_COMMON} will be used. @end defmac The definition of have_global_bss_p() is this: The following targets have no re-definition of BSS_SECTION_ASM_OP and no definition of ASM_OUTPUT_ALIGNED_BSS -bfin -cris -iq2000 -mcore -mips -mmix -moxie -pdp11 -vax The following of those targets seem to inherit TARGET_HAVE_SWITCHABLE_BSS_SECTIONS from config/elfos.h: -bfin (elf only) -cris (for cris-*-elf only) -iq2000 (elf only) -mcore (elf only) -mips (seems to be elf only, too?!) -moxie (elf only) That leaves pdp11, vax, and non-ELF cris as the only targets without .bss support. AFAICT, that is :-) Eric, do you remember a test case that was the reason for the patch that added this to utils.c? I would like to play with it, and see if I can understand why apparently the data didn't end up in a .bss section. Ciao1 Steven