diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2024-07-24 09:13:25 +0200 |
|---|---|---|
| committer | Alex Rønne Petersen <alex@alexrp.com> | 2024-07-24 20:12:38 +0200 |
| commit | 2dabb7ec778dcf7eb59162ced4d3ceacecba187a (patch) | |
| tree | c701d102b912eba93115e73fceb82a1fc1df4764 /lib/std/os/linux | |
| parent | 4de8bba648c6ab9e2f3a05f3f90ba6524520d3c0 (diff) | |
| download | zig-2dabb7ec778dcf7eb59162ced4d3ceacecba187a.tar.gz zig-2dabb7ec778dcf7eb59162ced4d3ceacecba187a.zip | |
std.os.linux.start_pie: Handle armeb, thumb, thumbeb, and aarch64_be too.
Diffstat (limited to 'lib/std/os/linux')
| -rw-r--r-- | lib/std/os/linux/start_pie.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/std/os/linux/start_pie.zig b/lib/std/os/linux/start_pie.zig index 9ab04e911b..6e7f00c006 100644 --- a/lib/std/os/linux/start_pie.zig +++ b/lib/std/os/linux/start_pie.zig @@ -16,8 +16,8 @@ const R_SPARC_RELATIVE = 22; const R_RELATIVE = switch (builtin.cpu.arch) { .x86 => R_386_RELATIVE, .x86_64 => R_AMD64_RELATIVE, - .arm => R_ARM_RELATIVE, - .aarch64 => R_AARCH64_RELATIVE, + .arm, .armeb, .thumb, .thumbeb => R_ARM_RELATIVE, + .aarch64, .aarch64_be => R_AARCH64_RELATIVE, .loongarch32, .loongarch64 => R_LARCH_RELATIVE, .m68k => R_68K_RELATIVE, .riscv64 => R_RISCV_RELATIVE, @@ -45,7 +45,7 @@ fn getDynamicSymbol() [*]elf.Dyn { : [ret] "=r" (-> [*]elf.Dyn), ), // Work around the limited offset range of `ldr` - .arm => asm volatile ( + .arm, .armeb, .thumb, .thumbeb => asm volatile ( \\ .weak _DYNAMIC \\ .hidden _DYNAMIC \\ ldr %[ret], 1f @@ -56,7 +56,7 @@ fn getDynamicSymbol() [*]elf.Dyn { : [ret] "=r" (-> [*]elf.Dyn), ), // A simple `adr` is not enough as it has a limited offset range - .aarch64 => asm volatile ( + .aarch64, .aarch64_be => asm volatile ( \\ .weak _DYNAMIC \\ .hidden _DYNAMIC \\ adrp %[ret], _DYNAMIC |
