public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Dimitar Dimitrov <dimitar@dinux.eu>
To: binutils@sourceware.org
Cc: Dimitar Dimitrov <dimitar@dinux.eu>
Subject: [PATCH] pru: bfd: Correct default to no execstack
Date: Sat, 12 Nov 2022 11:12:17 +0200	[thread overview]
Message-ID: <20221112091217.558020-1-dimitar@dinux.eu> (raw)

Data and instruction memories are strictly separated, so it is not
possible to execute instructions from the stack memory on PRU.

I don't see any difference in testsuite results with or without this
change.

Ok for trunk?

bfd/ChangeLog:

	* elf32-pru.c (elf_backend_default_execstack): Define as 0.

ld/ChangeLog:

	* testsuite/ld-elf/elf.exp (target_defaults_to_execstack):
	Return 0 for pru.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
---
 bfd/elf32-pru.c             | 2 ++
 ld/testsuite/ld-elf/elf.exp | 1 +
 2 files changed, 3 insertions(+)

diff --git a/bfd/elf32-pru.c b/bfd/elf32-pru.c
index 7a75fbd5036..a6ce478f4e2 100644
--- a/bfd/elf32-pru.c
+++ b/bfd/elf32-pru.c
@@ -1603,6 +1603,8 @@ pru_elf32_link_hash_table_create (bfd *abfd)
 #define bfd_elf32_bfd_relax_section	pru_elf32_relax_section
 #define elf_backend_can_gc_sections	1
 
+#define elf_backend_default_execstack	0
+
 #define TARGET_LITTLE_SYM		pru_elf32_vec
 #define TARGET_LITTLE_NAME		"elf32-pru"
 
diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp
index e4d8bee2f53..f9c74bf6bed 100644
--- a/ld/testsuite/ld-elf/elf.exp
+++ b/ld/testsuite/ld-elf/elf.exp
@@ -187,6 +187,7 @@ proc target_defaults_to_execstack {} {
 	|| [istarget "loongarch*-*-*"]
 	|| [istarget "nios2*-*-*"]
 	|| [istarget "powerpc64*-*-*"]
+	|| [istarget "pru*-*-*"]
 	|| [istarget "riscv*-*-*"]
 	|| [istarget "tilegx*-*-*"]
 	|| [istarget "tilepro*-*-*"] } {
-- 
2.38.1


             reply	other threads:[~2022-11-12  9:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-12  9:12 Dimitar Dimitrov [this message]
2022-11-14 13:52 ` Nick Clifton

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=20221112091217.558020-1-dimitar@dinux.eu \
    --to=dimitar@dinux.eu \
    --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).