authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-18 15:00:55+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-18 22:27:34+02:00
loge646c47f675be2dd83847717c3edda634d3e7dbb
tree0552920d7894eaa7234d9a7531b1f9c28bb14de8
parent2d5cdfcfc2f073111c42940475d5126c3ea50e5c
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.pie: add or1k support


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

lib/std/pie.zig+13
...@@ -13,6 +13,7 @@ const R_HEXAGON_RELATIVE = 35;...@@ -13,6 +13,7 @@ const R_HEXAGON_RELATIVE = 35;
13const R_LARCH_RELATIVE = 3;13const R_LARCH_RELATIVE = 3;
14const R_68K_RELATIVE = 22;14const R_68K_RELATIVE = 22;
15const R_MIPS_RELATIVE = 128;15const R_MIPS_RELATIVE = 128;
16const R_OR1K_RELATIVE = 21;
16const R_PPC_RELATIVE = 22;17const R_PPC_RELATIVE = 22;
17const R_RISCV_RELATIVE = 3;18const R_RISCV_RELATIVE = 3;
18const R_390_RELATIVE = 12;19const R_390_RELATIVE = 12;
...@@ -29,6 +30,7 @@ const R_RELATIVE = switch (builtin.cpu.arch) {...@@ -29,6 +30,7 @@ const R_RELATIVE = switch (builtin.cpu.arch) {
29 .loongarch32, .loongarch64 => R_LARCH_RELATIVE,30 .loongarch32, .loongarch64 => R_LARCH_RELATIVE,
30 .m68k => R_68K_RELATIVE,31 .m68k => R_68K_RELATIVE,
31 .mips, .mipsel, .mips64, .mips64el => R_MIPS_RELATIVE,32 .mips, .mipsel, .mips64, .mips64el => R_MIPS_RELATIVE,
33 .or1k => R_OR1K_RELATIVE,
32 .powerpc, .powerpcle, .powerpc64, .powerpc64le => R_PPC_RELATIVE,34 .powerpc, .powerpcle, .powerpc64, .powerpc64le => R_PPC_RELATIVE,
33 .riscv32, .riscv32be, .riscv64, .riscv64be => R_RISCV_RELATIVE,35 .riscv32, .riscv32be, .riscv64, .riscv64be => R_RISCV_RELATIVE,
34 .s390x => R_390_RELATIVE,36 .s390x => R_390_RELATIVE,
...@@ -153,6 +155,17 @@ inline fn getDynamicSymbol() [*]const elf.Dyn {...@@ -153,6 +155,17 @@ inline fn getDynamicSymbol() [*]const elf.Dyn {
153 :155 :
154 : .{ .lr = true }),156 : .{ .lr = true }),
155 },157 },
158 .or1k => asm volatile (
159 \\ .weak _DYNAMIC
160 \\ .hidden _DYNAMIC
161 \\ l.jal 1f
162 \\ .word _DYNAMIC - .
163 \\1:
164 \\ l.lwz %[ret], 0(r9)
165 \\ l.add %[ret], %[ret], r9
166 : [ret] "=r" (-> [*]const elf.Dyn),
167 :
168 : .{ .r9 = true }),
156 .powerpc, .powerpcle => asm volatile (169 .powerpc, .powerpcle => asm volatile (
157 \\ .weak _DYNAMIC170 \\ .weak _DYNAMIC
158 \\ .hidden _DYNAMIC171 \\ .hidden _DYNAMIC