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

Roland McGrath mcgrathr@google.com
Fri Mar 21 02:30:37 GMT 2025


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.

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