public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* RFC: possible bug in load_elf_binary
@ 2007-09-10 21:28 Chris Friesen
  2007-09-12 18:36 ` RFC: bug in load_elf_binary? Chris Friesen
  0 siblings, 1 reply; 5+ messages in thread
From: Chris Friesen @ 2007-09-10 21:28 UTC (permalink / raw)
  To: linux-kernel


Hi,

We've got an unusual elf binary and we seem to be running into a bug in 
the elf loader.  I'm not an elf expert, so my apologies if I get the 
terminology wrong.

The elf spec says that PT_LOAD segments must be ordered by vaddr.  We 
want to have a segment at a relatively low fixed vaddr.  The exact 
address is not important, except that it's lower than the standard elf 
headers and so it must be the first segment in the elf file.

However, this segment also has no size in the file...it's basically all 
statically allocated at runtime.

In the kernel elf loader, the p_vaddr and p_offset of the first segment 
are used to determine the load_addr for use with the rest of the 
segments.  In the case of this elf file, the first segment does not 
actually have a valid p_offset.

Anyone have any suggestions on how to deal with this?  One crude hack we 
considered was to simply not set the load_addr if the first segment 
doesn't have a valid p_offset, but that doesn't solve the general case.

Thanks,

Chris

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-09-14 18:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-10 21:28 RFC: possible bug in load_elf_binary Chris Friesen
2007-09-12 18:36 ` RFC: bug in load_elf_binary? Chris Friesen
2007-09-13 22:00   ` Jeremy Fitzhardinge
2007-09-13 23:25     ` Chris Friesen
2007-09-14 18:21       ` Jeremy Fitzhardinge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox