]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
aarch64: fix cfi directives around __libc_arm_za_disable
authorYury Khrustalev <yury.khrustalev@arm.com>
Tue, 28 Oct 2025 11:01:50 +0000 (11:01 +0000)
committerYury Khrustalev <yury.khrustalev@arm.com>
Fri, 31 Oct 2025 09:48:47 +0000 (09:48 +0000)
Incorrect CFI directive corrupted call stack information
and prevented debuggers from correctly displaying call
stack information.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
sysdeps/unix/sysv/linux/aarch64/sysdep.h

index 30003c01452abe4a1ce04b826af80504c6dfe0dc..8a7690d4a8ef41289db569029cc32ac2435f047b 100644 (file)
    that allows to call it without stack manipulation and preserving
    most of the registers.  */
        .macro CALL_LIBC_ARM_ZA_DISABLE
+       cfi_remember_state
        mov             x13, x30
-       .cfi_register   x30, x13
+       cfi_register(x30, x13)
        bl              __libc_arm_za_disable
        mov             x30, x13
-       .cfi_register   x13, x30
+       cfi_restore_state
        .endm
 
 #else /* not __ASSEMBLER__ */
 ({                                                     \
   unsigned long int __tmp;                             \
   asm volatile (                                       \
+  "    .cfi_remember_state\n"                  \
   "    mov             %0, x30\n"                      \
-  "    .cfi_register   x30, %0\n"                      \
+  "    .cfi_register x30, %0\n"      \
   "    bl              __libc_arm_za_disable\n"        \
   "    mov             x30, %0\n"                      \
-  "    .cfi_register   %0, x30\n"                      \
+  "    .cfi_restore_state\n"                   \
   : "=r" (__tmp)                                       \
   :                                                    \
   : "x14", "x15", "x16", "x17", "x18", "memory" );     \