authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-07-24 09:40:27+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-07-24 20:12:38+02:00
loga0b2b987c8a4252a1ae11937fc2affe6f48ee8df
treec04d5da855138c87302568c2b21d2b73d14db772
parentbc054a713e3316843dcf3089c6a4b09e52c19b02
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.os.linux.start_pie: Add arc support.


1 files changed, 8 insertions(+), 0 deletions(-)

lib/std/os/linux/start_pie.zig+8
......@@ -5,6 +5,7 @@ const assert = std.debug.assert;
55
66const R_AMD64_RELATIVE = 8;
77const R_386_RELATIVE = 8;
8const R_ARC_RELATIVE = 56;
89const R_ARM_RELATIVE = 23;
910const R_AARCH64_RELATIVE = 1027;
1011const R_CSKY_RELATIVE = 9;
......@@ -17,6 +18,7 @@ const R_SPARC_RELATIVE = 22;
1718const R_RELATIVE = switch (builtin.cpu.arch) {
1819 .x86 => R_386_RELATIVE,
1920 .x86_64 => R_AMD64_RELATIVE,
21 .arc => R_ARC_RELATIVE,
2022 .arm, .armeb, .thumb, .thumbeb => R_ARM_RELATIVE,
2123 .aarch64, .aarch64_be => R_AARCH64_RELATIVE,
2224 .csky => R_CSKY_RELATIVE,
......@@ -46,6 +48,12 @@ fn getDynamicSymbol() [*]elf.Dyn {
4648 \\ lea _DYNAMIC(%%rip), %[ret]
4749 : [ret] "=r" (-> [*]elf.Dyn),
4850 ),
51 .arc => asm volatile (
52 \\ .weak _DYNAMIC
53 \\ .hidden _DYNAMIC
54 \\ add %[ret], pcl, _DYNAMIC@pcl
55 : [ret] "=r" (-> [*]elf.Dyn),
56 ),
4957 // Work around the limited offset range of `ldr`
5058 .arm, .armeb, .thumb, .thumbeb => asm volatile (
5159 \\ .weak _DYNAMIC