aarch64: fix cfi directives around __libc_arm_za_disable

Incorrect CFI directive corrupted call stack information
and prevented debuggers from correctly displaying call
stack information.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
This commit is contained in:
Yury Khrustalev 2025-10-28 11:01:50 +00:00
parent 3ac0112b5d
commit 2f77aec043
1 changed files with 6 additions and 4 deletions

View File

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