[PATCH] remove check for ELF offset in powerpc bootimage

Simon Richter Simon.Richter at hogyros.de
Tue Jan 31 00:43:57 EST 2006


Hi,

Olaf Hering wrote:

> Is this check really needed, are there PT_LOAD sections with offset
> zero (either zImage or vmlinux)? I see an offset which is always 64k.

Sure, an offset of zero is completely legal (obviously, the start 
address would then be different from the load address of that segment).

Without context, I would say this loop is used to find some loadable 
segment that does not include the ELF header. I cannot think of any 
application for that, as it is certainly acceptable to merge LOAD 
segments, and the segment it is looking for could have been merged with 
the segment that includes the header.

If the current linker scripts specify that loading the header is 
unneeded, this means that all LOAD headers will have nonzero offsets. 
But I wouldn't count on that forever.[1]

    Simon

[1] the Amiga bootloader, for example, assumes that all segments are to 
be loaded, so things broke badly on APUS when the ldscript did not 
remove the .note.gnu-stack section, which has a VMA of zero as it is 
never loaded anyway. So depending on things being a particular way is 
bad. :-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 307 bytes
Desc: OpenPGP digital signature
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20060130/bd99885e/attachment.pgp>


More information about the Linuxppc-dev mailing list