aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/aarch64/setjmp.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/aarch64/setjmp.S')
-rw-r--r--sysdeps/aarch64/setjmp.S16
1 files changed, 15 insertions, 1 deletions
diff --git a/sysdeps/aarch64/setjmp.S b/sysdeps/aarch64/setjmp.S
index d82d62c..53c5e7d 100644
--- a/sysdeps/aarch64/setjmp.S
+++ b/sysdeps/aarch64/setjmp.S
@@ -35,6 +35,20 @@ libc_hidden_def (_setjmp)
ENTRY_ALIGN (__sigsetjmp, 2)
1:
+
+#if IS_IN(libc)
+ /* Disable ZA state of SME in libc.a and libc.so, but not in ld.so.
+ The calling convention of __libc_arm_za_disable allows to do
+ this thus allowing to avoid saving to and reading from stack.
+ As a result we also don't need to sign the return address and
+ check it after returning because it is not stored to stack. */
+ mov x13, x30
+ cfi_register (x30, x13)
+ bl __libc_arm_za_disable
+ mov x30, x13
+ cfi_register (x13, x30)
+#endif
+
stp x19, x20, [x0, #JB_X19<<3]
stp x21, x22, [x0, #JB_X21<<3]
stp x23, x24, [x0, #JB_X23<<3]
@@ -73,7 +87,7 @@ L(gcs_done):
#if IS_IN (rtld)
/* In ld.so we never save the signal mask */
mov w0, #0
- RET
+ ret
#else
b C_SYMBOL_NAME(__sigjmp_save)
#endif