mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH master] sandbox: fix linker warnings with newer ld
@ 2023-02-21  6:50 Ahmad Fatoum
  2023-02-21  7:44 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2023-02-21  6:50 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

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@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




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH master] sandbox: fix linker warnings with newer ld
  2023-02-21  6:50 [PATCH master] sandbox: fix linker warnings with newer ld Ahmad Fatoum
@ 2023-02-21  7:44 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2023-02-21  7:44 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Tue, Feb 21, 2023 at 07:50:47AM +0100, Ahmad Fatoum wrote:
> 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@a3f.at>
> ---
>  arch/sandbox/Makefile | 1 +
>  1 file changed, 1 insertion(+)

Applied, thanks

Sascha

> 
> 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
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-21  7:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-21  6:50 [PATCH master] sandbox: fix linker warnings with newer ld Ahmad Fatoum
2023-02-21  7:44 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox