[klibc] [PATCH] klibc: support llvm's lld for arm64

Andrew Delgadillo adelg at google.com
Tue Oct 13 14:37:04 PDT 2020


Use $(LD_IMAGE_BASE_OPT) instead of hardcoding --Ttext-segment,
which lld does not support. This allows either --Ttext-segment
or -image-base to be emitted based on the linker.

Signed-off-by: Andrew Delgadillo <adelg at google.com>
---
 usr/klibc/arch/arm64/MCONFIG | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr/klibc/arch/arm64/MCONFIG b/usr/klibc/arch/arm64/MCONFIG
index e31ffea79b0b9..f8741ff295d5c 100644
--- a/usr/klibc/arch/arm64/MCONFIG
+++ b/usr/klibc/arch/arm64/MCONFIG
@@ -20,7 +20,7 @@ KLIBCREQFLAGS += -fno-exceptions -mgeneral-regs-only
 
 # On arm64, binaries are normally loaded at 4MB. Place klibc.so
 # a little before that at 2MB to prevent overlap.
-KLIBCSHAREDFLAGS = -Ttext-segment 0x0200000
+KLIBCSHAREDFLAGS = $(LD_IMAGE_BASE_OPT) 0x0200000
 
 # Kernel has never used stack trampolines
 KLIBCEXECSTACK := n
-- 
2.28.0.1011.ga647a8990f-goog



More information about the klibc mailing list