mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <ahmad@a3f.at>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <ahmad@a3f.at>,
	Christian Melki <christian.melki@t2data.com>
Subject: [PATCH] Kbuild: link barebox with -z noexecstack
Date: Wed,  2 Nov 2022 13:48:42 +0100	[thread overview]
Message-ID: <20221102124842.2520783-1-ahmad@a3f.at> (raw)

We don't care for permission of ELF segments, but GNU ld (BFD)
does and now with binutils 2.39+, it reports:

  ld: warning: defaultenv/defaultenv-2-menu.bbenv.o: missing
  .note.GNU-stack section implies executable stack

  ld: NOTE: This behaviour is deprecated and will be removed in a future
  version of the linker

Instead of touching all assembly objects and scripts creating them to
add the section, just set -z noexecstack at link-time. This is already
the LLVM linker (lld) default.

Reported-by: Christian Melki <christian.melki@t2data.com>
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 26a0999a2e20..e57b8a4a1364 100644
--- a/Makefile
+++ b/Makefile
@@ -450,7 +450,7 @@ KBUILD_CFLAGS_KERNEL :=
 KBUILD_AFLAGS_MODULE := -DMODULE
 KBUILD_CFLAGS_MODULE := -DMODULE
 
-LDFLAGS_barebox	:= -Map barebox.map
+LDFLAGS_barebox	:= -Map barebox.map -z noexecstack
 
 # Avoid 'Not enough room for program headers' error on binutils 2.28 onwards.
 LDFLAGS_barebox += $(call ld-option, --no-dynamic-linker)
-- 
2.37.2




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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-02 12:48 Ahmad Fatoum [this message]
2022-11-02 12:55 ` Ahmad Fatoum
2022-11-05 12:15   ` Ahmad Fatoum

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=20221102124842.2520783-1-ahmad@a3f.at \
    --to=ahmad@a3f.at \
    --cc=barebox@lists.infradead.org \
    --cc=christian.melki@t2data.com \
    /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