[PATCH users/roland/aarch64-elf-relro] ld: Support RELRO in aarch64-elf target

Richard Earnshaw (lists) Richard.Earnshaw@arm.com
Mon Mar 24 16:03:56 GMT 2025


On 21/03/2025 02:30, Roland McGrath wrote:
> This brings aarch64-elf targets in line with other *-elf targets
> (x86_64-elf, riscv64-elf, etc.).  No testsuite failures appeared
> in my build for --target=aarch64-elf.
> 

What page size was your platform using?  I'm guessing 4k, but it would be interesting to know if this is correct on systems that use 16k or 64k pages.

R.

> Ok for trunk?
> 
> 
> Thanks,
> Roland
> 
> ---
> 
> Author: Roland McGrath <mcgrathr@google.com>
> Date:   Thu Mar 20 19:17:20 2025 -0700
> 
>     ld: Support RELRO in aarch64-elf target
> 
>     Other *-elf targets set COMMONPAGESIZE in emulparams/*.sh and so
>     enable `-z relro` and related features.  Make aarch64-elf match.
>     There is no reason to think that a "generic ELF" target should
>     have any particular set of features disabled.
> 
> diff --git a/ld/emulparams/aarch64elf.sh b/ld/emulparams/aarch64elf.sh
> index 72616b57691..aa051c76a7a 100644
> --- a/ld/emulparams/aarch64elf.sh
> +++ b/ld/emulparams/aarch64elf.sh
> @@ -18,6 +18,7 @@ GENERATE_SHLIB_SCRIPT=yes
>  GENERATE_PIE_SCRIPT=yes
> 
>  MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
> +COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
> 
>  ENTRY=_start
>  EMBEDDED=yes
> diff --git a/ld/emulparams/aarch64elf32.sh
> b/ld/emulparams/aarch64elf32.sh
> index 45bf31a179a..0565b7a066c 100644
> --- a/ld/emulparams/aarch64elf32.sh
> +++ b/ld/emulparams/aarch64elf32.sh
> @@ -18,6 +18,7 @@ GENERATE_SHLIB_SCRIPT=yes
>  GENERATE_PIE_SCRIPT=yes
> 
>  MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
> +COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
> 
>  ENTRY=_start
>  EMBEDDED=yes



More information about the Binutils mailing list