diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2024-07-24 09:40:27 +0200 |
|---|---|---|
| committer | Alex Rønne Petersen <alex@alexrp.com> | 2024-07-24 20:12:38 +0200 |
| commit | a0b2b987c8a4252a1ae11937fc2affe6f48ee8df (patch) | |
| tree | c04d5da855138c87302568c2b21d2b73d14db772 /lib/std/os/linux | |
| parent | bc054a713e3316843dcf3089c6a4b09e52c19b02 (diff) | |
| download | zig-a0b2b987c8a4252a1ae11937fc2affe6f48ee8df.tar.gz zig-a0b2b987c8a4252a1ae11937fc2affe6f48ee8df.zip | |
std.os.linux.start_pie: Add arc support.
Diffstat (limited to 'lib/std/os/linux')
| -rw-r--r-- | lib/std/os/linux/start_pie.zig | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/std/os/linux/start_pie.zig b/lib/std/os/linux/start_pie.zig index 7e6ecc763c..2f46ebb791 100644 --- a/lib/std/os/linux/start_pie.zig +++ b/lib/std/os/linux/start_pie.zig @@ -5,6 +5,7 @@ const assert = std.debug.assert; const R_AMD64_RELATIVE = 8; const R_386_RELATIVE = 8; +const R_ARC_RELATIVE = 56; const R_ARM_RELATIVE = 23; const R_AARCH64_RELATIVE = 1027; const R_CSKY_RELATIVE = 9; @@ -17,6 +18,7 @@ const R_SPARC_RELATIVE = 22; const R_RELATIVE = switch (builtin.cpu.arch) { .x86 => R_386_RELATIVE, .x86_64 => R_AMD64_RELATIVE, + .arc => R_ARC_RELATIVE, .arm, .armeb, .thumb, .thumbeb => R_ARM_RELATIVE, .aarch64, .aarch64_be => R_AARCH64_RELATIVE, .csky => R_CSKY_RELATIVE, @@ -46,6 +48,12 @@ fn getDynamicSymbol() [*]elf.Dyn { \\ lea _DYNAMIC(%%rip), %[ret] : [ret] "=r" (-> [*]elf.Dyn), ), + .arc => asm volatile ( + \\ .weak _DYNAMIC + \\ .hidden _DYNAMIC + \\ add %[ret], pcl, _DYNAMIC@pcl + : [ret] "=r" (-> [*]elf.Dyn), + ), // Work around the limited offset range of `ldr` .arm, .armeb, .thumb, .thumbeb => asm volatile ( \\ .weak _DYNAMIC |
