Skip to content

Commit

Permalink
ld: Extend ac_default_ld_warn_rwx_segments to all SPARC targets [PR29…
Browse files Browse the repository at this point in the history
…411]

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  <[email protected]>

	ld:
	PR ld/29411
	* configure.tgt (ac_default_ld_warn_rwx_segments): Extend to all
	sparc targets.  Expand comment.
  • Loading branch information
rorth committed Jul 29, 2022
1 parent b245c59 commit b80b72c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions ld/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2022-07-29 Rainer Orth <[email protected]>

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

2022-07-26 Nick Clifton <[email protected]>

PR 29411
Expand Down
6 changes: 3 additions & 3 deletions ld/configure.tgt
Original file line number Diff line number Diff line change
Expand Up @@ -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
;;
*)
Expand Down

0 comments on commit b80b72c

Please sign in to comment.