aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2021-12-29 18:32:30 +0100
committerBen Hutchings <ben@decadent.org.uk>2021-12-29 21:30:39 +0100
commit84d60fb75c0d8eaebc76da029130657f6c683ff3 (patch)
tree64fe6d9004709ea9bd1484e062dfffd32feeec57
parent2851d6a3ad9955ca264736c6e6789bdb88632ad7 (diff)
downloadklibc-84d60fb75c0d8eaebc76da029130657f6c683ff3.tar.gz
[klibc] arm64,x86_64: Fix address collision when using LLDklibc-2.0.10
LLD 13 is using a default base address of 2 MB for executables on these architectures, and since we set the base address of klibc.so to 2 MB they are now colliding with each other. Explicitly set the base address to 4 MB, matching GNU ld's default. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r--usr/klibc/arch/arm64/MCONFIG1
-rw-r--r--usr/klibc/arch/x86_64/MCONFIG2
2 files changed, 2 insertions, 1 deletions
diff --git a/usr/klibc/arch/arm64/MCONFIG b/usr/klibc/arch/arm64/MCONFIG
index f8741ff295d5c0..b90568ecfcfa65 100644
--- a/usr/klibc/arch/arm64/MCONFIG
+++ b/usr/klibc/arch/arm64/MCONFIG
@@ -13,6 +13,7 @@ CPU_TUNE ?= generic
KLIBCOPTFLAGS += -g -Os -march=$(CPU_ARCH) -mtune=$(CPU_TUNE)
KLIBCBITSIZE = 64
KLIBCREQFLAGS += -fno-exceptions -mgeneral-regs-only
+KLIBCLDFLAGS = $(LD_IMAGE_BASE_OPT) 0x00400000
# Extra linkflags when building the shared version of the library
# This address needs to be reachable using normal inter-module
diff --git a/usr/klibc/arch/x86_64/MCONFIG b/usr/klibc/arch/x86_64/MCONFIG
index 307b48fb260b90..70d690e331aa1b 100644
--- a/usr/klibc/arch/x86_64/MCONFIG
+++ b/usr/klibc/arch/x86_64/MCONFIG
@@ -25,7 +25,7 @@ else
KLIBCOPTFLAGS += -fno-asynchronous-unwind-tables
endif
KLIBCBITSIZE = 64
-KLIBCLDFLAGS = -m elf_x86_64
+KLIBCLDFLAGS = -m elf_x86_64 $(LD_IMAGE_BASE_OPT) 0x00400000
# Extra linkflags when building the shared version of the library
# This address needs to be reachable using normal inter-module