[patch] bfd_elf_bfd_from_remote_memory() workaround for the ELF misalignment [Re: loadbase alignment - ld.so/prelink/kernel or bfd_elf_bfd_from_remote_memory() bug?]
Daniel Jacobowitz
drow@false.org
Tue Aug 21 20:44:00 GMT 2007
On Tue, Aug 21, 2007 at 06:50:12AM -0700, H.J. Lu wrote:
> No. The new parameter should be the maximum page size at run-time,
> which is >= MINPAGESIZE and may be default to MINPAGESIZE.
What practical consequence does it have to use a too small value here?
The segment's size should be large enough to cover all the memory it
uses - in deliberately malicious cases that may not be true but I
don't think it's a problem in this context since more values in the
header could be wrong than just this one.
So if you align to the architecturally minimum page size you should
find the whole library.
But then, I'm not even clear on why we need to honor p_align. We're
trying to create an _ELF file_ from memory, not a loaded image. We
only need the bits that would have been in the file!
--
Daniel Jacobowitz
CodeSourcery
More information about the Binutils
mailing list