H.J. Lu wrote: > On Wed, Apr 15, 2009 at 7:34 AM, Dave Korn > <dave.korn.cyg...@googlemail.com> wrote: >> Jakub Jelinek wrote: >>> On Wed, Apr 15, 2009 at 03:27:01PM +0100, Dave Korn wrote: >>>>> It does look like a Cygwin specific issue. >>>> Can you tell me whether Linux treats COMMON as a separate section with >>>> its >>>> own alignment, or otherwise takes steps to ensure it has a base alignment >>>> that >>>> the compiler can assume? Otherwise I expect I need to look at the cygwin >>>> definitions of the ASM_OUTPUT_COMMON* macros. >>> In ELF each STT_COMMON symbol has both size (st_size) and alignment >>> (st_value) and the linker is of course required to lay out all the common >>> symbols in a way that their alignment requirements are satisfied. >> Ah, thanks. I think probably PE doesn't support that and will need explicit >> .align pseudo-ops inserted in the assembly. I'm AFK for a few hours now but >> will pursue this later tonight. >> > > If your COMMON doesn't support alignment, you may need to use .bss with > .align.
It does indeed look that way. Only ELF supports COMMON symbol alignment, and the x86 backend just disregards it: i386_pe_asm_output_aligned_decl_common from config/i386/winnt.c ignores the alignment parameter altogether. That certainly means this is not a regression then. Thanks for all the pointers, everyone. cheers, DaveK