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;
1616const R_RELATIVE = switch (builtin.cpu.arch) {
1717 .x86 => R_386_RELATIVE,
1818 .x86_64 => R_AMD64_RELATIVE,
19 .arm => R_ARM_RELATIVE,
20 .aarch64 => R_AARCH64_RELATIVE,
19 .arm, .armeb, .thumb, .thumbeb => R_ARM_RELATIVE,
20 .aarch64, .aarch64_be => R_AARCH64_RELATIVE,
2121 .loongarch32, .loongarch64 => R_LARCH_RELATIVE,
2222 .m68k => R_68K_RELATIVE,
2323 .riscv64 => R_RISCV_RELATIVE,
......@@ -45,7 +45,7 @@ fn getDynamicSymbol() [*]elf.Dyn {
4545 : [ret] "=r" (-> [*]elf.Dyn),
4646 ),
4747 // Work around the limited offset range of `ldr`
48 .arm => asm volatile (
48 .arm, .armeb, .thumb, .thumbeb => asm volatile (
4949 \\ .weak _DYNAMIC
5050 \\ .hidden _DYNAMIC
5151 \\ ldr %[ret], 1f
......@@ -56,7 +56,7 @@ fn getDynamicSymbol() [*]elf.Dyn {
5656 : [ret] "=r" (-> [*]elf.Dyn),
5757 ),
5858 // A simple `adr` is not enough as it has a limited offset range
59 .aarch64 => asm volatile (
59 .aarch64, .aarch64_be => asm volatile (
6060 \\ .weak _DYNAMIC
6161 \\ .hidden _DYNAMIC
6262 \\ adrp %[ret], _DYNAMIC