[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200407080611.859256-1-jiaxun.yang@flygoat.com>
Date: Tue, 7 Apr 2020 16:06:11 +0800
From: Jiaxun Yang <jiaxun.yang@...goat.com>
To: linux-mips@...r.kernel.org
Cc: Jiaxun Yang <jiaxun.yang@...goat.com>,
clang-built-linux@...glegroups.com,
Fangrui Song <maskray@...gle.com>,
Nathan Chancellor <natechancellor@...il.com>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
linux-kernel@...r.kernel.org
Subject: [PATCH v2] MIPS: Truncate load-y into 32bit for 32bit kernel
LLD failed to link vmlinux with 64bit load address for 32bit ELF
while bfd will strip 64bit address into 32bit silently.
To fix LLD build, we should truncate load address provided by platform
into 32bit for 32bit kernel.
Signed-off-by: Jiaxun Yang <jiaxun.yang@...goat.com>
Reviewed-by: Fangrui Song <maskray@...gle.com>
Tested-by: Nathan Chancellor <natechancellor@...il.com>
--
V2: Take MaskRay's shell magic.
---
arch/mips/Makefile | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index e1c44aed8156..f8fd3c39fb55 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -286,6 +286,9 @@ ifdef CONFIG_64BIT
$(error CONFIG_CPU_DADDI_WORKAROUNDS unsupported without -msym32)
endif
endif
+else
+ # Truncate address into 32-bit
+ load-y := 0x$(shell echo "$(load-y)" | rev | head -c 8 | rev)
endif
KBUILD_AFLAGS += $(cflags-y)
--
2.26.0.rc2
Powered by blists - more mailing lists