]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
ld: Extend ac_default_ld_warn_rwx_segments to all SPARC targets [PR29411]
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Fri, 29 Jul 2022 07:06:40 +0000 (09:06 +0200)
committerRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Fri, 29 Jul 2022 07:06:40 +0000 (09:06 +0200)
As discussed in PR ld/29411, the ld warning

[...] has a LOAD segment with RWX permissions

needs to be disabled on all SPARC targets, not just Solaris/SPARC: the
.plt section is required to be RWX by the 32-bit SPARC ELF psABI and the
64-bit SPARC Compliance Definition 2.4.1.  Given that ld only supports
SPARC ELF targets, this patch implements this.

Tested on sparc64-unknown-linux-gnu and sparc-sun-solaris2.11.

2022-07-28  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

ld:
PR ld/29411
* configure.tgt (ac_default_ld_warn_rwx_segments): Extend to all
sparc targets.  Expand comment.

ld/ChangeLog
ld/configure.tgt

index ac1365a16c6d61bc426327b2e41ca64876e3bb14..30fc1937d069ff47c0bf4306e66148b94f88ffc1 100644 (file)
@@ -1,3 +1,9 @@
+2022-07-29  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       PR ld/29411
+       * configure.tgt (ac_default_ld_warn_rwx_segments): Extend to all
+       sparc targets.  Expand comment.
+
 2022-07-26  Nick Clifton  <nickc@redhat.com>
 
        PR 29411
index 1a3c7df0ae8ae2241fc90aea550e5cd056fef4dc..2bae9099b6aae1f23afa5be74e84aeb7626d1058 100644 (file)
@@ -49,13 +49,13 @@ if test "${ac_default_ld_warn_rwx_segments}" = unset; then
   case "${targ}" in
       # The CRIS default linker script yields just one segment
       # as intended, so a rwx segment warning is not helpful.
-      # The HPPA's PLT section uses a constructed trampoline
+      # The HPPA's and SPARC's PLT sections use a constructed trampoline
       # hence it needs to have a RWX segment.
       # Many MIPS targets use executable segments.
     cris-*-* | crisv32-*-* | \
     hppa*-*-* | \
-    sparc*-*-solaris2* | \
-    mips*-*-*)
+    mips*-*-* | \
+    sparc*-*-*)
       ac_default_ld_warn_rwx_segments=0
       ;;
     *)