authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-23 03:39:58+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-23 09:27:17+02:00
logfb2c02929e9325d2912d7d0bab1eb501b747c496
tree20e74c8411957e9f9ade56e9434ab70b05c1c273
parentfc48f8aa553e3d0c03393d976e36f217099cab25
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.pie: add microblaze support


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

lib/std/pie.zig+6
......@@ -13,6 +13,7 @@ const R_CSKY_RELATIVE = 9;
1313const R_HEXAGON_RELATIVE = 35;
1414const R_LARCH_RELATIVE = 3;
1515const R_68K_RELATIVE = 22;
16const R_MICROBLAZE_REL = 16;
1617const R_MIPS_RELATIVE = 128;
1718const R_OR1K_RELATIVE = 21;
1819const R_PPC_RELATIVE = 22;
......@@ -31,6 +32,7 @@ const R_RELATIVE = switch (builtin.cpu.arch) {
3132 .hexagon => R_HEXAGON_RELATIVE,
3233 .loongarch32, .loongarch64 => R_LARCH_RELATIVE,
3334 .m68k => R_68K_RELATIVE,
35 .microblaze, .microblazeel => R_MICROBLAZE_REL,
3436 .mips, .mipsel, .mips64, .mips64el => R_MIPS_RELATIVE,
3537 .or1k => R_OR1K_RELATIVE,
3638 .powerpc, .powerpcle, .powerpc64, .powerpc64le => R_PPC_RELATIVE,
......@@ -129,6 +131,10 @@ inline fn getDynamicSymbol() [*]const elf.Dyn {
129131 \\ lea (%[ret], %%pc), %[ret]
130132 : [ret] "=r" (-> [*]const elf.Dyn),
131133 ),
134 .microblaze, .microblazeel => asm volatile (
135 \\ lwi %[ret], r20, 0
136 : [ret] "=r" (-> [*]const elf.Dyn),
137 ),
132138 .mips, .mipsel => asm volatile (
133139 \\ .weak _DYNAMIC
134140 \\ .hidden _DYNAMIC