[PATCH master] sandbox: fix linker warnings with newer ld

Ahmad Fatoum ahmad at a3f.at
Mon Feb 20 22:50:47 PST 2023


Building with a newer ld results in two warnings:

    binutils-2.39/bin/ld: warning: defaultenv/defaultenv-2-reboot-mode.bbenv.gz.o:
    missing .note.GNU-stack section implies executable stack
    binutils-2.39/bin/ld: NOTE: This behaviour is deprecated and will be removed
    in a future version of the linker
    binutils-2.39/bin/ld: warning: barebox has a LOAD segment with RWX permissions

This is already fixed for the non-sandbox platform with a4b49c69c3ad
("Kbuild: link with -z noexecstack and --no-warn-rwx-segments"), but
sandbox has its own cmd_barebox__, so add the equivalent to the sandbox
Makefile as well.

Signed-off-by: Ahmad Fatoum <ahmad at a3f.at>
---
 arch/sandbox/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile
index d5ba05ba866f..0f59e79e13e0 100644
--- a/arch/sandbox/Makefile
+++ b/arch/sandbox/Makefile
@@ -69,6 +69,7 @@ BAREBOX_LDFLAGS += \
 	-Wl,-T,$(BAREBOX_LDS) \
 	-Wl,--whole-archive $(BAREBOX_OBJS) -Wl,--no-whole-archive \
 	-lrt -pthread $(SDL_LIBS) $(FTDI1_LIBS) \
+	-Wl,-z noexecstack $(call cc-option,-Wl$(comma)--no-warn-rwx-segments) \
 	$(SANITIZER_LIBS)
 
 cmd_barebox__ = $(CC) -o $@ $(BAREBOX_LDFLAGS)
-- 
2.38.3




More information about the barebox mailing list