aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2019-01-20 19:41:47 +0000
committerBen Hutchings <ben@decadent.org.uk>2019-01-20 21:15:17 +0000
commit72d6d78a8f0d24a64911c246487402c81b4beb9d (patch)
tree0470c22208d9814da7bfca928c64aed38a978086
parenta2f9cd4abe2d5cb72e1e89089b132e866e3cea81 (diff)
downloadklibc-72d6d78a8f0d24a64911c246487402c81b4beb9d.tar.gz
[klibc] Use -Ttext-segment to link shared library on all arches
We previously changed mips and x86 to link the shared library with the -Ttext-segment option to avoid address collisions with extra sections automatically added by the linker (commits 048bfb0df170, 2a705525e081, 34163a2c7d1c). Adding a build ID to support separate debug info causes a similar problem on other architectures. Use -Ttext-segment on all architectures. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r--usr/klibc/arch/alpha/MCONFIG2
-rw-r--r--usr/klibc/arch/arm/MCONFIG4
-rw-r--r--usr/klibc/arch/arm64/MCONFIG2
-rw-r--r--usr/klibc/arch/m68k/MCONFIG2
-rw-r--r--usr/klibc/arch/parisc/MCONFIG2
-rw-r--r--usr/klibc/arch/ppc/MCONFIG2
-rw-r--r--usr/klibc/arch/ppc64/MCONFIG2
-rw-r--r--usr/klibc/arch/riscv64/MCONFIG2
-rw-r--r--usr/klibc/arch/s390/MCONFIG2
-rw-r--r--usr/klibc/arch/sh/MCONFIG2
-rw-r--r--usr/klibc/arch/sparc/MCONFIG2
-rw-r--r--usr/klibc/arch/sparc64/MCONFIG2
12 files changed, 13 insertions, 13 deletions
diff --git a/usr/klibc/arch/alpha/MCONFIG b/usr/klibc/arch/alpha/MCONFIG
index e7dc61a576f8a4..ad11372f92660f 100644
--- a/usr/klibc/arch/alpha/MCONFIG
+++ b/usr/klibc/arch/alpha/MCONFIG
@@ -13,4 +13,4 @@ KLIBCBITSIZE = 64
# calls, and work on the memory models for this architecture
# 7 GB - normal binaries start at 4.5 GB, and the stack is below
# the binary.
-KLIBCSHAREDFLAGS = -Ttext 0x1c0000200
+KLIBCSHAREDFLAGS = -Ttext-segment 0x1c0000000
diff --git a/usr/klibc/arch/arm/MCONFIG b/usr/klibc/arch/arm/MCONFIG
index 53bc1dc3d41f40..8a7096b8cced23 100644
--- a/usr/klibc/arch/arm/MCONFIG
+++ b/usr/klibc/arch/arm/MCONFIG
@@ -21,12 +21,12 @@ KLIBCREQFLAGS += -mthumb
KLIBCLDFLAGS += --thumb-entry _start
KLIBCEMAIN = --thumb-entry main
KLIBCREQFLAGS += -mabi=aapcs-linux
-KLIBCSHAREDFLAGS = -Ttext 0x380200
+KLIBCSHAREDFLAGS = -Ttext-segment 0x380000
else
# Extra linkflags when building the shared version of the library
# This address needs to be reachable using normal inter-module
# calls, and work on the memory models for this architecture
-KLIBCSHAREDFLAGS = -Ttext 0x01800200
+KLIBCSHAREDFLAGS = -Ttext-segment 0x01800000
ifeq ($(CONFIG_AEABI),y)
KLIBCREQFLAGS += -mabi=aapcs-linux -mno-thumb-interwork
else
diff --git a/usr/klibc/arch/arm64/MCONFIG b/usr/klibc/arch/arm64/MCONFIG
index 82664a7b7f5ed3..6d22847e670aec 100644
--- a/usr/klibc/arch/arm64/MCONFIG
+++ b/usr/klibc/arch/arm64/MCONFIG
@@ -20,4 +20,4 @@ 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 0x0200000
+KLIBCSHAREDFLAGS = -Ttext-segment 0x0200000
diff --git a/usr/klibc/arch/m68k/MCONFIG b/usr/klibc/arch/m68k/MCONFIG
index 7d4615d9cdcead..3f4bdae645e4b0 100644
--- a/usr/klibc/arch/m68k/MCONFIG
+++ b/usr/klibc/arch/m68k/MCONFIG
@@ -16,4 +16,4 @@ KLIBCBITSIZE = 32
# 2816 MB - normal binaries start at 2048 MB if I read the link
# script right. Not sure if there is a fundamental reason
# to not duck below the halfway point...
-KLIBCSHAREDFLAGS = -Ttext 0xb0000000
+KLIBCSHAREDFLAGS = -Ttext-segment 0xb0000000
diff --git a/usr/klibc/arch/parisc/MCONFIG b/usr/klibc/arch/parisc/MCONFIG
index 628e98773d6630..3472df67572ca4 100644
--- a/usr/klibc/arch/parisc/MCONFIG
+++ b/usr/klibc/arch/parisc/MCONFIG
@@ -9,4 +9,4 @@
KLIBCOPTFLAGS += -Os -fomit-frame-pointer
KLIBCBITSIZE = 32
-KLIBCSHAREDFLAGS = -Ttext 0x40001000
+KLIBCSHAREDFLAGS = -Ttext-segment 0x40001000
diff --git a/usr/klibc/arch/ppc/MCONFIG b/usr/klibc/arch/ppc/MCONFIG
index 46c5923746f740..8220f6b93fa4f5 100644
--- a/usr/klibc/arch/ppc/MCONFIG
+++ b/usr/klibc/arch/ppc/MCONFIG
@@ -20,7 +20,7 @@ KLIBCBITSIZE = 32
# calls, and work on the memory models for this architecture
# 256-16 MB - normal binaries start at 256 MB, and jumps are limited
# to +/- 16 MB
-KLIBCSHAREDFLAGS = -Ttext 0x0f800200
+KLIBCSHAREDFLAGS = -Ttext-segment 0x0f800000
# The asm include files live in asm-powerpc
KLIBCASMARCH = powerpc
diff --git a/usr/klibc/arch/ppc64/MCONFIG b/usr/klibc/arch/ppc64/MCONFIG
index a1475935fd3af2..0315110ca37995 100644
--- a/usr/klibc/arch/ppc64/MCONFIG
+++ b/usr/klibc/arch/ppc64/MCONFIG
@@ -18,7 +18,7 @@ KLIBCBITSIZE = 64
# calls, and work on the memory models for this architecture
# 256-16 MB - normal binaries start at 256 MB, and jumps are limited
# to +/- 16 MB
-KLIBCSHAREDFLAGS = -Ttext 0x0f000200
+KLIBCSHAREDFLAGS = -Ttext-segment 0x0f000000
# The asm include files live in asm-powerpc
KLIBCASMARCH = powerpc
diff --git a/usr/klibc/arch/riscv64/MCONFIG b/usr/klibc/arch/riscv64/MCONFIG
index 34f077414f8c7c..61681509d89d28 100644
--- a/usr/klibc/arch/riscv64/MCONFIG
+++ b/usr/klibc/arch/riscv64/MCONFIG
@@ -17,4 +17,4 @@ endif
KLIBCBITSIZE = 64
# Normal binaries start at 64 KB, so start the libary at 2 MB.
-KLIBCSHAREDFLAGS =-Ttext 0x00200200
+KLIBCSHAREDFLAGS =-Ttext-segment 0x00200000
diff --git a/usr/klibc/arch/s390/MCONFIG b/usr/klibc/arch/s390/MCONFIG
index 82d9a74552d52e..637f5aa67ba7f5 100644
--- a/usr/klibc/arch/s390/MCONFIG
+++ b/usr/klibc/arch/s390/MCONFIG
@@ -20,4 +20,4 @@ else
endif
KLIBCASMARCH = s390
-KLIBCSHAREDFLAGS = -Ttext 0x40000200
+KLIBCSHAREDFLAGS = -Ttext-segment 0x40000000
diff --git a/usr/klibc/arch/sh/MCONFIG b/usr/klibc/arch/sh/MCONFIG
index 665abb25093ca0..2facf7cb5d29ad 100644
--- a/usr/klibc/arch/sh/MCONFIG
+++ b/usr/klibc/arch/sh/MCONFIG
@@ -14,4 +14,4 @@ KLIBCBITSIZE = 32
# This address needs to be reachable using normal inter-module
# calls, and work on the memory models for this architecture
# 2 MB -- the normal starting point for text is 4 MB.
-KLIBCSHAREDFLAGS = -Ttext 0x00200200
+KLIBCSHAREDFLAGS = -Ttext-segment 0x00200000
diff --git a/usr/klibc/arch/sparc/MCONFIG b/usr/klibc/arch/sparc/MCONFIG
index 235ce60cc290b0..0623fdc2824b33 100644
--- a/usr/klibc/arch/sparc/MCONFIG
+++ b/usr/klibc/arch/sparc/MCONFIG
@@ -16,4 +16,4 @@ KLIBCARCHREQFLAGS += -D__sparc32__
# calls, and work on the memory models for this architecture
# Normal binaries start at 64K; the linker wants 64K alignment,
# and call instructions have a 30-bit signed offset, << 2.
-KLIBCSHAREDFLAGS = -Ttext 0x40000100
+KLIBCSHAREDFLAGS = -Ttext-segment 0x40000000
diff --git a/usr/klibc/arch/sparc64/MCONFIG b/usr/klibc/arch/sparc64/MCONFIG
index bd6f0047e977ca..c83398559f8460 100644
--- a/usr/klibc/arch/sparc64/MCONFIG
+++ b/usr/klibc/arch/sparc64/MCONFIG
@@ -18,4 +18,4 @@ KLIBCLDFLAGS = -m elf64_sparc
# calls, and work on the memory models for this architecture
# Normal binaries start at 1 MB; the linker wants 1 MB alignment,
# and call instructions have a 30-bit signed offset, << 2.
-KLIBCSHAREDFLAGS = -Ttext 0x80000200
+KLIBCSHAREDFLAGS = -Ttext-segment 0x80000000