All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc: Suppress 'executable stack' warning at link
@ 2023-03-24 13:10 Christophe Leroy
  2023-03-24 16:05 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe Leroy @ 2023-03-24 13:10 UTC (permalink / raw)
  To: Tom Rini; +Cc: Christophe Leroy, u-boot, Stephane Franjou

Following warning is observed at link.

  powerpc-linux-ld.bfd: warning: arch/powerpc/lib/reloc.o: missing .note.GNU-stack section implies executable stack
  powerpc-linux-ld.bfd: NOTE: This behaviour is deprecated and will be removed in a future version of the linker

Add -zexecstack to KBUILD_LDFLAGS in order to suppress this warning.

Reported-by: Stephane Franjou <stephane.franjou@csgroup.eu>
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
 arch/powerpc/config.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk
index 725a4f48aa..53124f4e80 100644
--- a/arch/powerpc/config.mk
+++ b/arch/powerpc/config.mk
@@ -10,7 +10,7 @@ PLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections \
 
 PF_CPPFLAGS_POWERPC	:= $(call cc-option,-fno-ira-hoist-pressure,)
 PLATFORM_CPPFLAGS += -D__powerpc__ -ffixed-r2 -m32 $(PF_CPPFLAGS_POWERPC)
-KBUILD_LDFLAGS  += -m32 -melf32ppclinux
+KBUILD_LDFLAGS  += -m32 -melf32ppclinux -zexecstack
 
 #
 # When cross-compiling on NetBSD, we have to define __PPC__ or else we
-- 
2.39.2


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

* Re: [PATCH] powerpc: Suppress 'executable stack' warning at link
  2023-03-24 13:10 [PATCH] powerpc: Suppress 'executable stack' warning at link Christophe Leroy
@ 2023-03-24 16:05 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2023-03-24 16:05 UTC (permalink / raw)
  To: Christophe Leroy; +Cc: u-boot, Stephane Franjou

[-- Attachment #1: Type: text/plain, Size: 1452 bytes --]

On Fri, Mar 24, 2023 at 02:10:35PM +0100, Christophe Leroy wrote:

> Following warning is observed at link.
> 
>   powerpc-linux-ld.bfd: warning: arch/powerpc/lib/reloc.o: missing .note.GNU-stack section implies executable stack
>   powerpc-linux-ld.bfd: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
> 
> Add -zexecstack to KBUILD_LDFLAGS in order to suppress this warning.
> 
> Reported-by: Stephane Franjou <stephane.franjou@csgroup.eu>
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>

This has been addressed in -next with:
commit 57450d8661b3ec2e6b6f1d938e59f426cafb06d2
Author: Tom Rini <trini@konsulko.com>
Date:   Tue Feb 14 15:09:31 2023 -0500

    Makefile: Link with -z noexectack
    
    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>

I didn't put this in master as (as far as I know) we're merely telling
the toolchain we're being intentional, and not changing the behavior.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

end of thread, other threads:[~2023-03-24 16:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-24 13:10 [PATCH] powerpc: Suppress 'executable stack' warning at link Christophe Leroy
2023-03-24 16:05 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.