Question about section alignment

Nick Clifton nickc@redhat.com
Fri Feb 22 14:30:00 GMT 2008


Hi Robert,

> I found that in binutils-2.17.50

(Just a quick aside - we have now released version 2.18 and development 
on 2.19 continues apace...)


>      /* On a native system other than VxWorks, sections must be aligned
>         to 16 byte boundaries.  When configured for an embedded ELF
>         target, we don't bother.  */

> I don't kow why these sections  must be set to 16 byte boundaries,

I asked the MIPS maintainers about this - the consensus was that 16 
bytes was chosen for future compatibility with MIPS variants that might 
need that alignment for 128-bit data types (eg long doubles).  There are 
no such variants yet, but they may appear one day.

If you find that reducing the alignment restriction to 4 bytes works for 
you (and produces some kind of space saving) then by all means carry on 
doing that, but the official MIPS port is going to keep the 16 byte 
alignment requirement just in case it is needed in the future.

Cheers
   Nick



More information about the Binutils mailing list