Skip to content

Commit ca26893

Browse files
committed
arch: enable packed relative relocation via DT_RELR
This feature is supported by Binutils on amd64, arm64, loongarch64, and ppc64el.
1 parent 81b9028 commit ca26893

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

arch/amd64.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ HWCAPS=('x86-64-v2' 'x86-64-v3' 'x86-64-v4')
99
# Default -march and μarch specific tuning.
1010
# No need to reference CFLAGS_COMMON_ARCH_BASE, it will be concatenated.
1111
CFLAGS_COMMON_ARCH=('-march=x86-64' '-mtune=znver4' '-msse2' '-mno-omit-leaf-frame-pointer')
12+
LDFLAGS_COMMON_ARCH=('-Wl,-z,pack-relative-relocs')
1213
RUSTFLAGS_COMMON_ARCH=('-Ctarget-cpu=x86-64')
1314

1415
# HWCAPS subtargets in x86-64 are based on the microarchitecture levels

arch/arm64.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
##arch/arm64.sh: Build definitions for arm64.
33
##@copyright GPL-2.0+
44
CFLAGS_COMMON_ARCH=('-march=armv8-a' '-mtune=generic' '-mno-omit-leaf-frame-pointer')
5+
LDFLAGS_COMMON_ARCH=('-Wl,-z,pack-relative-relocs')
56
RUSTFLAGS_COMMON_ARCH=('-Ctarget-cpu=generic')
67
# LDFLAGS_COMMON_CROSS=('-Wl,-rpath -Wl,/usr/lib -Wl,-rpath-link -Wl,/var/ab/cross-root/arm64/usr/lib -L/var/ab/cross-root/arm64/usr/lib ')

arch/loongarch64.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@ else
3333
CFLAGS_COMMON_ARCH+=('-march=loongarch64' '-mtune=la464')
3434
fi
3535

36+
LDFLAGS_COMMON_ARCH=('-Wl,-z,pack-relative-relocs')
3637
RUSTFLAGS_COMMON_ARCH=('-Ctarget-cpu=generic-la64' '-Ctarget-feature=+lsx,+d' '-Clink-arg=-mabi=lp64d')

arch/ppc64el.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
##arch/ppc64el.sh: Build definitions for ppc64el.
33
##@copyright GPL-2.0+
44
CFLAGS_COMMON_ARCH_BASE=('-msecure-plt' '-mabi=ieeelongdouble')
5+
LDFLAGS_COMMON_ARCH=('-Wl,-z,pack-relative-relocs')
56
CFLAGS_COMMON_ARCH=('-mcpu=power8' '-mtune=power10' '-mvsx')
67
RUSTFLAGS_COMMON_ARCH=('-Ctarget-cpu=pwr8' '-Ctarget-feature=+vsx,+altivec,+secure-plt' '-Clink-arg=-mabi=ieeelongdouble')
78

0 commit comments

Comments
 (0)