authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-07-24 09:13:25+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-07-24 20:12:38+02:00
log2dabb7ec778dcf7eb59162ced4d3ceacecba187a
treec701d102b912eba93115e73fceb82a1fc1df4764
parent4de8bba648c6ab9e2f3a05f3f90ba6524520d3c0
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.os.linux.start_pie: Handle armeb, thumb, thumbeb, and aarch64_be too.


1 files changed, 4 insertions(+), 4 deletions(-)

lib/std/os/linux/start_pie.zig+4-4
...@@ -16,8 +16,8 @@ const R_SPARC_RELATIVE = 22;...@@ -16,8 +16,8 @@ const R_SPARC_RELATIVE = 22;
16const R_RELATIVE = switch (builtin.cpu.arch) {16const R_RELATIVE = switch (builtin.cpu.arch) {
17 .x86 => R_386_RELATIVE,17 .x86 => R_386_RELATIVE,
18 .x86_64 => R_AMD64_RELATIVE,18 .x86_64 => R_AMD64_RELATIVE,
19 .arm => R_ARM_RELATIVE,19 .arm, .armeb, .thumb, .thumbeb => R_ARM_RELATIVE,
20 .aarch64 => R_AARCH64_RELATIVE,20 .aarch64, .aarch64_be => R_AARCH64_RELATIVE,
21 .loongarch32, .loongarch64 => R_LARCH_RELATIVE,21 .loongarch32, .loongarch64 => R_LARCH_RELATIVE,
22 .m68k => R_68K_RELATIVE,22 .m68k => R_68K_RELATIVE,
23 .riscv64 => R_RISCV_RELATIVE,23 .riscv64 => R_RISCV_RELATIVE,
...@@ -45,7 +45,7 @@ fn getDynamicSymbol() [*]elf.Dyn {...@@ -45,7 +45,7 @@ fn getDynamicSymbol() [*]elf.Dyn {
45 : [ret] "=r" (-> [*]elf.Dyn),45 : [ret] "=r" (-> [*]elf.Dyn),
46 ),46 ),
47 // Work around the limited offset range of `ldr`47 // Work around the limited offset range of `ldr`
48 .arm => asm volatile (48 .arm, .armeb, .thumb, .thumbeb => asm volatile (
49 \\ .weak _DYNAMIC49 \\ .weak _DYNAMIC
50 \\ .hidden _DYNAMIC50 \\ .hidden _DYNAMIC
51 \\ ldr %[ret], 1f51 \\ ldr %[ret], 1f
...@@ -56,7 +56,7 @@ fn getDynamicSymbol() [*]elf.Dyn {...@@ -56,7 +56,7 @@ fn getDynamicSymbol() [*]elf.Dyn {
56 : [ret] "=r" (-> [*]elf.Dyn),56 : [ret] "=r" (-> [*]elf.Dyn),
57 ),57 ),
58 // A simple `adr` is not enough as it has a limited offset range58 // A simple `adr` is not enough as it has a limited offset range
59 .aarch64 => asm volatile (59 .aarch64, .aarch64_be => asm volatile (
60 \\ .weak _DYNAMIC60 \\ .weak _DYNAMIC
61 \\ .hidden _DYNAMIC61 \\ .hidden _DYNAMIC
62 \\ adrp %[ret], _DYNAMIC62 \\ adrp %[ret], _DYNAMIC