Makefile: Link with -z noexectack
authorTom Rini <trini@konsulko.com>
Tue, 14 Feb 2023 20:09:31 +0000 (15:09 -0500)
committerTom Rini <trini@konsulko.com>
Thu, 23 Feb 2023 18:29:19 +0000 (13:29 -0500)
When moving to gcc-12.2 we started trying to quiet some of the new
linker warnings, that are not relevant to us. However, a
misunderstanding of the mechanics at play meant that I intentionally
omitted passing -z noexecstack to the linker, when we do need to. Add
this flag and in turn remove warnings from the linker.

Fixes: 1e1c51f8ace8 ("Makefile: link with --no-warn-rwx-segments")
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Makefile

index 54f894dab841f98934f22633fd4ccb2b13a307dd..bc1ee94fb74eee86d2d85467edbff17cac79658e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -806,6 +806,7 @@ KBUILD_CPPFLAGS += $(KCPPFLAGS)
 KBUILD_AFLAGS += $(KAFLAGS)
 KBUILD_CFLAGS += $(KCFLAGS)
 
+KBUILD_LDFLAGS  += -z noexecstack
 KBUILD_LDFLAGS  += $(call ld-option,--no-warn-rwx-segments)
 
 KBUILD_HOSTCFLAGS += $(if $(CONFIG_TOOLS_DEBUG),-g)