authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-06-22 15:01:44+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-07-29 09:50:41+02:00
logaeb3abc7e649386f518638727c4d8a79dc00fc60
tree288e11c086f09caf30fa9658003ec17c9abcb26b
parent43410cdfe91548408083327e428404b192ced524
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.os.linux.start_pie: Handle riscv32 in getDynamicSymbol().


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

lib/std/os/linux/start_pie.zig+2-2
......@@ -26,7 +26,7 @@ const R_RELATIVE = switch (builtin.cpu.arch) {
2626 .hexagon => R_HEXAGON_RELATIVE,
2727 .loongarch32, .loongarch64 => R_LARCH_RELATIVE,
2828 .m68k => R_68K_RELATIVE,
29 .riscv64 => R_RISCV_RELATIVE,
29 .riscv32, .riscv64 => R_RISCV_RELATIVE,
3030 .s390x => R_390_RELATIVE,
3131 else => @compileError("Missing R_RELATIVE definition for this target"),
3232};
......@@ -111,7 +111,7 @@ fn getDynamicSymbol() [*]elf.Dyn {
111111 \\ lea (%[ret], %%pc), %[ret]
112112 : [ret] "=r" (-> [*]elf.Dyn),
113113 ),
114 .riscv64 => asm volatile (
114 .riscv32, .riscv64 => asm volatile (
115115 \\ .weak _DYNAMIC
116116 \\ .hidden _DYNAMIC
117117 \\ lla %[ret], _DYNAMIC