[PATCH v2] elf: Set p_align to the minimum page size if possible

Alan Modra amodra@gmail.com
Sat Dec 25 01:03:39 GMT 2021


On Wed, Dec 22, 2021 at 06:38:54AM -0800, H.J. Lu wrote:
> I choose commonpagesize due to this glibc bug:
> 
> https://sourceware.org/bugzilla/show_bug.cgi?id=28688

This means we are stuck.  Choosing commonpagesize or minpagesize will
generate binaries that won't run with older glibc if the actual page
size is maxpagesize (assuming maxpagesize != commonpagesize).

I don't see a way to change DT_LOAD p_align that is backwards
compatible, except perhaps using a p_align of zero if the required
segment alignment (as calculated from section alignment) is less than
maxpagesize.  That horrible hack just happens to work for older glibc,
but may break other loaders.

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list