Encoding page size in the ELF header
Rich Felker
dalias@libc.org
Mon Sep 28 14:24:00 GMT 2015
On Mon, Sep 28, 2015 at 03:55:37PM +0200, Florian Weimer wrote:
> On 09/25/2015 09:58 PM, Roland McGrath wrote:
> > p_align indicates the maximum page size that a given binary is built to
> > handle. What is the precise definition of "expected" that you have in mind?
>
> Interesting. I thought it was more of a minimum alignment for that segment.
In a sense it's both. The loader should align to at least this
alignment (but I don't think that's actually implemented, is it?)
which makes it a "minimum alignment". The actual "maximum alignment"
is not p_align but rather:
lcm { (ph[i].p_vaddr-ph[i].p_offset) - (ph[j].p_vaddr-ph[j].p_offset) }
where i,j range over all PT_LOAD headers. With a larger page size you
cannot simultaneously satisfy the displacement constraints between
segments.
Rich
More information about the Libc-alpha
mailing list