summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2022-11-08 11:41:29 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2022-11-08 11:48:54 +0100
commita4b49c69c3ad1cf0e92943921a699fbe586b5706 (patch)
treecc12e4eac97cf4afa441180442361534abf4b43e /Makefile
parent99878ae30e4fe5cba5d80f67082e5c3c5478e9ed (diff)
downloadbarebox-a4b49c69c3ad1cf0e92943921a699fbe586b5706.tar.gz
Kbuild: link with -z noexecstack and --no-warn-rwx-segments
Users of GNU ld (BFD) from binutils 2.39+ will observe multiple instances of a new warning when linking barebox and PBL in the form: ld: warning: defaultenv/defaultenv-2-dfu.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 ld: warning: .tmp_barebox1 has a LOAD segment with RWX permissions We don't need executable stack, so disable with -z noexecstack. We also do not use the permissions from ELF segments, so disable the warning with --no-warn-rwx-segments. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
1 files changed, 4 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 12882ef4cf..de0329c761 100644
--- a/Makefile
+++ b/Makefile
@@ -454,6 +454,10 @@ LDFLAGS_barebox := -Map barebox.map
# Avoid 'Not enough room for program headers' error on binutils 2.28 onwards.
LDFLAGS_common += $(call ld-option, --no-dynamic-linker)
+# Avoid 'missing .note.GNU-stack section implies executable stack' warnings on binutils 2.39+
+LDFLAGS_common += -z noexecstack
+# Avoid '... has a LOAD segment with RWX permissions' warnings on binutils 2.39+
+LDFLAGS_common += $(call ld-option,--no-warn-rwx-segments)
LDFLAGS_barebox += $(LDFLAGS_common)
LDFLAGS_pbl += $(LDFLAGS_common)