leading padding in ELF segment

Nathan Sidwell nathan@codesourcery.com
Tue Dec 12 16:06:00 GMT 2006


Paul Brook wrote:

> I've also seen armcc generate similar things.
> 
> Many OS require the file offset to be aligned so they can use mmap, but I 
> think that's an OS specific requirements on top of the basic ELF spec.

I thought that alignment applied to segments not sections.  BFD seems slightly 
confused about that, in that it sets a segment's alignment from the maximally 
aligned contained section (and looking at the algorithm it uses, I think it only 
works when the first section is the maximally aligned one.  Because a later 
section's offset depends on the sizes of the preceeding sections).

nathan
-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::         CodeSourcery
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk



More information about the Binutils mailing list