[PATCH] x86: Fix linker warning seen with binutils 2.39

6 views
Skip to first unread message

Himanshu Chauhan

unread,
Jun 28, 2024, 5:46:37 AM6/28/24
to xvisor...@googlegroups.com, Himanshu Chauhan
The latest binutils 2.39 throw a linker warning
"missing .note.GNU-stack section implies executable stack"
when compiling for x86.

This patch fixes the above linker warning.

Signed-off-by: Himanshu Chauhan <hima...@thechauhan.dev>
---
arch/x86/board/x86_64_generic/objects.mk | 2 +-
arch/x86/cpu/x86_64/objects.mk | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/x86/board/x86_64_generic/objects.mk b/arch/x86/board/x86_64_generic/objects.mk
index 4f7d0b55..e4d23b37 100644
--- a/arch/x86/board/x86_64_generic/objects.mk
+++ b/arch/x86/board/x86_64_generic/objects.mk
@@ -22,7 +22,7 @@
# */

board-asflags+=
-board-ldflags+=
+board-ldflags+= -z noexecstack

board-objs-y+= brd_main.o
board-objs-y+= brd_defterm.o
diff --git a/arch/x86/cpu/x86_64/objects.mk b/arch/x86/cpu/x86_64/objects.mk
index 2e7458f8..847f5021 100644
--- a/arch/x86/cpu/x86_64/objects.mk
+++ b/arch/x86/cpu/x86_64/objects.mk
@@ -32,6 +32,8 @@ cpu-cflags += -no-pie
cpu-cppflags += -no-pie
endif

+cpu-mergeflags += -z noexecstack
+
cpu-objs-y+= start.o

#These commented out files are what we will need to
--
2.43.0

Anup Patel

unread,
Jul 1, 2024, 9:03:43 AM7/1/24
to xvisor...@googlegroups.com, Himanshu Chauhan
On Fri, Jun 28, 2024 at 3:16 PM Himanshu Chauhan
<hima...@thechauhan.dev> wrote:
>
> The latest binutils 2.39 throw a linker warning
> "missing .note.GNU-stack section implies executable stack"
> when compiling for x86.
>
> This patch fixes the above linker warning.
>
> Signed-off-by: Himanshu Chauhan <hima...@thechauhan.dev>

LGTM.

Reviewed-by: Anup Patel <an...@brainfault.org>

Applied this patch to the xvisor-next repo.

Thanks,
Anup
> --
> You received this message because you are subscribed to the Google Groups "Xvisor Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to xvisor-devel...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/xvisor-devel/20240628094628.807993-1-himanshu%40thechauhan.dev.
Reply all
Reply to author
Forward
0 new messages