Skip to contentSkip to conversation

Revert "kbuild: Check if linker supports the -X option"

PATCH In review Masahiro Yamada 3 participants 3 messages Sep 29, 2022 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "kbuild: Check if linker supports the -X option"

This reverts commit d79a27195a33f4b5e591de5536799ad874ea6cf5.

According to the commit description, this ld-option test was added for the gold linker at that time.

Commit 75959d44f9dc ("kbuild: Fail if gold linker is detected") gave up the gold linker support after all.

I tested the BFD linker from binutils 2.23 and LLD from LLVM 11.0.0. Both of them support the -X option.

---

 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 49dcae886c48..d7c85ec79000 100644
@@ -1037,7 +1037,7 @@ KBUILD_LDFLAGS	+= $(call ld-option,--no-warn-rwx-segments)
 endif
 
 ifeq ($(CONFIG_STRIP_ASM_SYMS),y)
-LDFLAGS_vmlinux	+= $(call ld-option, -X,)
+LDFLAGS_vmlinux	+= -X
 endif
 
 ifeq ($(CONFIG_RELR),y)
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Masahiro Yamada

This reverts commit d79a27195a33f4b5e591de5536799ad874ea6cf5.

According to the commit description, this ld-option test was added for the gold linker at that time.

Quoted 7 lines

Commit 75959d44f9dc ("kbuild: Fail if gold linker is detected") gave up the gold linker support after all.

I tested the BFD linker from binutils 2.23 and LLD from LLVM 11.0.0. Both of them support the -X option.

Thanks for the patch!

Quoted 21 lines

---

 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -2
index 49dcae886c48..d7c85ec79000 100644
@@ -1037,7 +1037,7 @@ KBUILD_LDFLAGS    += $(call ld-option,--no-warn-rwx-segments)
 endif
 
 ifeq ($(CONFIG_STRIP_ASM_SYMS),y)
-LDFLAGS_vmlinux        += $(call ld-option, -X,)
+LDFLAGS_vmlinux        += -X
 endif
 
 ifeq ($(CONFIG_RELR),y)
--

2.34.1

Signature · 2 lines
Thanks,
~Nick Desaulniers
maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Masahiro Yamada
Quoted 5 lines · Masahiro Yamada

This reverts commit d79a27195a33f4b5e591de5536799ad874ea6cf5.

According to the commit description, this ld-option test was added for the gold linker at that time.

Quoted 7 lines

Commit 75959d44f9dc ("kbuild: Fail if gold linker is detected") gave up the gold linker support after all.

I tested the BFD linker from binutils 2.23 and LLD from LLVM 11.0.0. Both of them support the -X option.

Quoted 21 lines

---

 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 49dcae886c48..d7c85ec79000 100644
@@ -1037,7 +1037,7 @@ KBUILD_LDFLAGS	+= $(call ld-option,--no-warn-rwx-segments)
 endif
 
 ifeq ($(CONFIG_STRIP_ASM_SYMS),y)
-LDFLAGS_vmlinux	+= $(call ld-option, -X,)
+LDFLAGS_vmlinux	+= -X
 endif
 
 ifeq ($(CONFIG_RELR),y)
Signature · 1 line
2.34.1