public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Hans-Peter Nilsson <hp@axis.com>
To: <binutils@sourceware.org>
Subject: [COMMITTED] cris: bfd: Correct default to no execstack
Date: Fri, 27 May 2022 01:20:49 +0200	[thread overview]
Message-ID: <20220526232049.7365120439@pchp3.se.axis.com> (raw)

In the now-historical CRIS glibc port, the default stack permission
was no-exec as in "#define DEFAULT_STACK_PERMS (PF_R|PF_W)", and the
gcc port only emits the executable-stack marker when needed; when
emitting code needing it.  In other words, the binutils setting
mismatches.  It doesn't matter much, except being confusing and
defaulting to "off" is more sane.

ld:

	* testsuite/ld-elf/elf.exp (target_defaults_to_execstack): Switch to 0
	for cris*-*-*.

bfd:
	* elf32-cris.c (elf_backend_default_execstack): Define to 0.

Change-Id: I52f37598f119b19111c7a6546c00a627fca0f396
---
 bfd/elf32-cris.c            | 2 ++
 ld/testsuite/ld-elf/elf.exp | 1 +
 2 files changed, 3 insertions(+)

diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c
index 00b5f7745e89..653d77f1ea84 100644
--- a/bfd/elf32-cris.c
+++ b/bfd/elf32-cris.c
@@ -4112,6 +4112,8 @@ elf_cris_got_elt_size (bfd *abfd ATTRIBUTE_UNUSED,
 #define elf_backend_dtrel_excludes_plt	1
 #define elf_backend_want_dynrelro	1
 
+#define elf_backend_default_execstack	0
+
 /* Later, we my want to optimize RELA entries into REL entries for dynamic
    linking and libraries (if it's a win of any significance).  Until then,
    take the easy route.  */
diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp
index 621d4e121d74..abc35f807782 100644
--- a/ld/testsuite/ld-elf/elf.exp
+++ b/ld/testsuite/ld-elf/elf.exp
@@ -183,6 +183,7 @@ if { [check_gc_sections_available] && ![istarget "v850-*-*"] } {
 proc target_defaults_to_execstack {} {
     if {   [istarget "aarch64*-*-*"]
 	|| [istarget "arc*-*-*"]
+	|| [istarget "cris*-*-*"]
 	|| [istarget "ia64*-*-*"]
 	|| [istarget "nios2*-*-*"]
 	|| [istarget "powerpc64*-*-*"]
-- 
2.30.2

brgds, H-P

                 reply	other threads:[~2022-05-26 23:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220526232049.7365120439@pchp3.se.axis.com \
    --to=hp@axis.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).