Mail Archives: djgpp-workers/1999/04/28/13:41:40
> 8-byte alignment is my vote. Note that a global alignment is wrong,
> because ctor/dtor tables will get corrupted if they're padded.
>
I still think that thre should be at least 16-byte alignment.
egcs which will try to maintain the 16-byte alignment in the .text section
for jumps and loops when compiling with -m486.
And there shouldn't be any problem with ctor/dtor tables. From
binutils-2.8.1/bfd/coffcode.h:
/* The .stab section must be aligned to 2**2 at most, because
otherwise there may be gaps in the section which gdb will not
know how to interpret. Examining the section name is a hack, but
that is also how gdb locates the section.
We need to handle the .ctors and .dtors sections similarly, to
avoid introducing null words in the tables. */
if (COFF_DEFAULT_SECTION_ALIGNMENT_POWER > 2
&& (strncmp (section->name, ".stab", 5) == 0
|| strcmp (section->name, ".ctors") == 0
|| strcmp (section->name, ".dtors") == 0))
section->alignment_power = 2;
/* Similarly, the .stabstr section must be aligned to 2**0 at most. */
if (COFF_DEFAULT_SECTION_ALIGNMENT_POWER > 0
&& strncmp (section->name, ".stabstr", 8) == 0)
section->alignment_power = 0;
- Raw text -