authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-08-08 19:13:18+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-08-09 16:56:25+02:00
logee1983a985c013905f23a95adbac77cbd6e578f2
treed2dae4c1128f8119fe9e13941a2a8fbc060fc6eb
parent82b9ba071f33f7404db5d987232493dd122e991a
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.pie: fix sparc assembly to actually load &_DYNAMIC

It was loading &_GLOBAL_OFFSET_TABLE_[0] rather than &_DYNAMIC. I suspect that I committed this before actually finishing writing it.

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

lib/std/pie.zig+6-6
......@@ -271,17 +271,17 @@ inline fn getDynamicSymbol() [*]const elf.Dyn {
271271 : [ret] "=r" (-> [*]const elf.Dyn),
272272 :
273273 : .{ .r0 = true }),
274 // The compiler does not necessarily have any obligation to load the `l7` register (pointing
275 // to the GOT), so do it ourselves just in case.
276274 .sparc, .sparc64 => asm volatile (
277 \\ sethi %%hi(_GLOBAL_OFFSET_TABLE_ - 4), %%l7
275 \\ .weak _DYNAMIC
276 \\ .hidden _DYNAMIC
277 \\ sethi %%pc22(_DYNAMIC - 4), %[ret]
278278 \\ call 1f
279 \\ add %%l7, %%lo(_GLOBAL_OFFSET_TABLE_ + 4), %%l7
279 \\ add %[ret], %%pc10(_DYNAMIC + 4), %[ret]
280280 \\1:
281 \\ add %%l7, %%o7, %[ret]
281 \\ add %[ret], %%o7, %[ret]
282282 : [ret] "=r" (-> [*]const elf.Dyn),
283283 :
284 : .{ .l7 = true }),
284 : .{ .o7 = true }),
285285 .xtensa, .xtensaeb => asm volatile (
286286 \\ .weak _DYNAMIC
287287 \\ .hidden _DYNAMIC