authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-09-22 18:36:47+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-09-24 01:11:02+02:00
logb8f2fec0f2d66427c8f947979fee8173099c690c
tree970d0b6c6ae6f5ab29a2a36efc56bae5e62d8ea1
parent9694c83b954d1bd4a3f224ef69d75639e6da56c7
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.pie: fix register constraint in getDynamicSymbol() for s390x (#25327)

If the compiler happens to pick `ret = r0`, then this will assemble to `ag r0, 0` which is obviously not what we want. Using `a` instead of `r` will ensure that we get an appropriate address register, i.e. `r1` through `r15`. Re-enable pie_linux for s390x-linux which was disabled in ed7ff0b693037078f451a7c6c1124611060f4892.

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

lib/std/pie.zig+1-1
......@@ -177,7 +177,7 @@ inline fn getDynamicSymbol() [*]const elf.Dyn {
177177 \\ jg 2f
178178 \\ 1: .quad _DYNAMIC - .
179179 \\ 2:
180 : [ret] "=r" (-> [*]const elf.Dyn),
180 : [ret] "=a" (-> [*]const elf.Dyn),
181181 ),
182182 // The compiler does not necessarily have any obligation to load the `l7` register (pointing
183183 // to the GOT), so do it ourselves just in case.