Question about ELF_COMMONPAGESIZE and Fedora downstream change to it

Alan Modra amodra@gmail.com
Sun Aug 17 22:41:28 GMT 2025


On Sun, Aug 17, 2025 at 11:04:06PM +0800, Xi Ruoyao via Binutils wrote:
> Hi,
> 
> In Fedora recipe for Binutils there is a command changing
> ELF_COMMONPAGESIZE for ppc64 and arm64:
> 	
> # On ppc64 and aarch64, we might use 64KiB pages
> sed -i -e '/#define.*ELF_COMMONPAGESIZE/s/0x1000$/0x10000/' bfd/elf*ppc.c
> sed -i -e '/#define.*ELF_COMMONPAGESIZE/s/0x1000$/0x10000/' bfd/elf*aarch64.c
> 
> So does it mean to support a 64KiB-page configuration on ppc64 and
> aarch64 we must use ELF_COMMONPAGESIZE = 64Ki?  But if so what's the
> point of ELF_MAXPAGESIZE then?
> 
> I tried to find some clue in the BFD info page but I found nothing about
> ELF_COMMONPAGESIZE there.

My guess is that this change was to avoid bugs in relro segment
layout.  It used to be that the relro segment was allowed to finish on
a commonpagesize boundary, but if hardware pages are actually
maxpagesize then the end of the relro segment became read/write.  See
commit 9833b7757d24.

-- 
Alan Modra


More information about the Binutils mailing list