Skip to contentSkip to conversation

MIPS: generic: Support linking with LLVM ld.lld

PATCH New Paul Cercueil 2 participants 2 messages Mar 21, 2021 – Mar 22, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: generic: Support linking with LLVM ld.lld

LLVM's ld.lld chokes on the 64-bit sign-extended load addresses. Use 32-bit addresses if the linker is LLVM's ld.lld.

---
 arch/mips/generic/Platform | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/mips/generic/Platform +2 -2
index b871af16b5b6..19b7d92a4ca7 100644
@@ -12,8 +12,8 @@
 cflags-$(CONFIG_MACH_INGENIC_SOC)	+= -I$(srctree)/arch/mips/include/asm/mach-ingenic
 cflags-$(CONFIG_MIPS_GENERIC)	+= -I$(srctree)/arch/mips/include/asm/mach-generic
 
-load-$(CONFIG_MIPS_GENERIC)	+= 0xffffffff80100000
-zload-$(CONFIG_MIPS_GENERIC)	+= 0xffffffff81000000
+load-$(CONFIG_MIPS_GENERIC)		+= $(if $(CONFIG_LD_IS_LLD),0x80100000,0xffffffff80100000)
+zload-$(CONFIG_MIPS_GENERIC)	+= $(if $(CONFIG_LD_IS_LLD),0x81000000,0xffffffff81000000)
 all-$(CONFIG_MIPS_GENERIC)	:= vmlinux.gz.itb
 
 its-y					:= vmlinux.its.S
Signature · 1 line
2.30.2
#1 lore raw

PATCH 1/1 MIPS: generic: Support linking with LLVM ld.lld

From: Paul Cercueil <[email protected]>
Date: Sun, 21 Mar 2021 13:18:05 +0000

Quoted 13 lines

LLVM's ld.lld chokes on the 64-bit sign-extended load addresses. Use 32-bit addresses if the linker is LLVM's ld.lld.

---
 arch/mips/generic/Platform | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/mips/generic/Platform +0 -0
index b871af16b5b6..19b7d92a4ca7 100644

arch/mips/generic/Platform line 17

Quoted 8 lines
arch/mips/generic/Platform +2 -2
@@ -12,8 +12,8 @@
 cflags-$(CONFIG_MACH_INGENIC_SOC)	+= -I$(srctree)/arch/mips/include/asm/mach-ingenic
 cflags-$(CONFIG_MIPS_GENERIC)	+= -I$(srctree)/arch/mips/include/asm/mach-generic
 
-load-$(CONFIG_MIPS_GENERIC)	+= 0xffffffff80100000
-zload-$(CONFIG_MIPS_GENERIC)	+= 0xffffffff81000000
+load-$(CONFIG_MIPS_GENERIC)		+= $(if $(CONFIG_LD_IS_LLD),0x80100000,0xffffffff80100000)
+zload-$(CONFIG_MIPS_GENERIC)	+= $(if $(CONFIG_LD_IS_LLD),0x81000000,0xffffffff81000000)
 all-$(CONFIG_MIPS_GENERIC)	:= vmlinux.gz.itb

For load-y, it's handled in arch/mips/Makefile:289 arch-wide. For zload-y, it's not handled at all, but the proper way to do this is to add a similar to load-ld logics in arch/mips/boot/compressed/Makefile.

Quoted 3 lines
arch/mips/generic/Platform +0 -1
 its-y					:= vmlinux.its.S
--

2.30.2

Thanks,
Al