]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
powerpc64[le]: Allocate extra stack frame on syscall.S
authorMatheus Castanho <msc@linux.ibm.com>
Wed, 1 Dec 2021 14:14:40 +0000 (11:14 -0300)
committerMatheus Castanho <msc@linux.ibm.com>
Fri, 17 Dec 2021 18:40:53 +0000 (15:40 -0300)
The syscall function does not allocate the extra stack frame for scv like other
assembly syscalls using DO_CALL_SCV. So after commit d120fb9941 changed the
offset that is used to save LR, syscall ended up using an invalid offset,
causing regressions on powerpc64. So make sure the extra stack frame is
allocated in syscall.S as well to make it consistent with other uses of
DO_CALL_SCV and avoid similar issues in the future.

Tested on powerpc, powerpc64, and powerpc64le (with and without scv)

Reviewed-by: Raphael M Zinsly <rzinsly@linux.ibm.com>
sysdeps/unix/sysv/linux/powerpc/syscall.S

index a29652feaf6764cf7feff94d4d1de83adccff1d9..a5497c8370982fe30a28196744e17fbae5b7fb75 100644 (file)
@@ -27,7 +27,11 @@ ENTRY (syscall)
        mr   r8,r9
 #if defined(USE_PPC_SCV) && !IS_IN(rtld) && (defined(__PPC64__) || defined(__powerpc64__))
        CHECK_SCV_SUPPORT r9 0f
+       stdu r1,-SCV_FRAME_SIZE(r1)
+       cfi_adjust_cfa_offset(SCV_FRAME_SIZE)
        DO_CALL_SCV
+       addi r1,r1,SCV_FRAME_SIZE
+       cfi_adjust_cfa_offset(-SCV_FRAME_SIZE)
        RET_SCV
        b 1f
 #endif