[PATCH] bfd: Fix Solaris/x86 ELF_MAXPAGESIZE

Jan Beulich jbeulich@suse.com
Fri Aug 15 13:01:32 GMT 2025


On 15.08.2025 14:45, Rainer Orth wrote:
> I noticed that the alignment of the .text and .data sections on
> Solaris/x86 doesn't match what /bin/ld does: gld uses the original i386
> psABI default of 0x1000, while Solaris has moved to larger values as can
> be seen both in the Oracle Solaris 11.4 Linkers and Libraries Guide,
> ch. 15, Program Loading and Dynamic Linking, p. 15-6 and the system
> headers (<sys/elf_{i386,amd64}.h>) that have
> 
> #define	ELF_386_MAXPGSZ		0x10000
> #define	ELF_AMD64_MAXPGSZ	0x100000	/* maximum page size */
> 
> while the Solaris/SPARC values are already correct.
> 
> #define	ELF_SPARC_MAXPGSZ	0x10000		/* maximum page size */
> #define	ELF_SPARCV9_MAXPGSZ	0x100000
> 
> This patch fixes that.  While on i386 it's sufficient to redefine
> ELF_MAXPAGESIZE, x86_64 uses ELF_P_ALIGN instead.

I don't quite follow this last sentence. ELF_P_ALIGN is used solely to set
the p_align field in struct elf_backend_data. It's okay if that's what is
needed for Solaris, but then the wording is a little odd and it remains
unclear why i386 would be different in this regard.

Jan


More information about the Binutils mailing list