authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-08-08 19:11:14+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-08-09 16:56:25+02:00
log37d1bdb8a7b700b900dd83c8c5c85296f5c3c17a
tree0b69527014769de2d219fdcf16c9c813a3e7e564
parent962b4bbebf484487d6ff71a957fcc3d0afda470b
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.pie: fix potentially unaligned quadword load in powerpc64 assembly

It probably happened to be quadword aligned by coincidence, or real hardware can cope with misaligned loads. Either way, we should just align it properly.

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

lib/std/pie.zig+3-1
......@@ -230,11 +230,13 @@ inline fn getDynamicSymbol() [*]const elf.Dyn {
230230 .powerpc64, .powerpc64le => asm volatile (
231231 \\ .weak _DYNAMIC
232232 \\ .hidden _DYNAMIC
233 \\ .balign 8
233234 \\ bl 1f
235 \\ nop
234236 \\ .quad _DYNAMIC - .
235237 \\1:
236238 \\ mflr %[ret]
237 \\ ld 4, 0(%[ret])
239 \\ ld 4, 4(%[ret])
238240 \\ add %[ret], 4, %[ret]
239241 : [ret] "=r" (-> [*]const elf.Dyn),
240242 :