diff options
Diffstat (limited to 'sysdeps/aarch64/__longjmp.S')
-rw-r--r-- | sysdeps/aarch64/__longjmp.S | 72 |
1 files changed, 32 insertions, 40 deletions
diff --git a/sysdeps/aarch64/__longjmp.S b/sysdeps/aarch64/__longjmp.S index 981bf80..70ac02c 100644 --- a/sysdeps/aarch64/__longjmp.S +++ b/sysdeps/aarch64/__longjmp.S @@ -24,51 +24,43 @@ /* __longjmp(jmpbuf, val) */ ENTRY (__longjmp) - cfi_def_cfa(x0, 0) - cfi_offset(x19, JB_X19<<3) - cfi_offset(x20, JB_X20<<3) - cfi_offset(x21, JB_X21<<3) - cfi_offset(x22, JB_X22<<3) - cfi_offset(x23, JB_X23<<3) - cfi_offset(x24, JB_X24<<3) - cfi_offset(x25, JB_X25<<3) - cfi_offset(x26, JB_X26<<3) - cfi_offset(x27, JB_X27<<3) - cfi_offset(x28, JB_X28<<3) - cfi_offset(x29, JB_X29<<3) - cfi_offset(x30, JB_LR<<3) - - cfi_offset( d8, JB_D8<<3) - cfi_offset( d9, JB_D9<<3) - cfi_offset(d10, JB_D10<<3) - cfi_offset(d11, JB_D11<<3) - cfi_offset(d12, JB_D12<<3) - cfi_offset(d13, JB_D13<<3) - cfi_offset(d14, JB_D14<<3) - cfi_offset(d15, JB_D15<<3) #if IS_IN(libc) - /* Disable ZA state of SME in libc.a and libc.so, but not in ld.so. */ -# if HAVE_AARCH64_PAC_RET - PACIASP - cfi_window_save -# endif - stp x29, x30, [sp, -16]! - cfi_adjust_cfa_offset (16) - cfi_rel_offset (x29, 0) - cfi_rel_offset (x30, 8) - mov x29, sp + /* 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 - ldp x29, x30, [sp], 16 - cfi_adjust_cfa_offset (-16) - cfi_restore (x29) - cfi_restore (x30) -# if HAVE_AARCH64_PAC_RET - AUTIASP - cfi_window_save -# endif + mov x30, x13 + cfi_register (x13, x30) #endif + cfi_def_cfa (x0, 0) + cfi_offset (x19, JB_X19<<3) + cfi_offset (x20, JB_X20<<3) + cfi_offset (x21, JB_X21<<3) + cfi_offset (x22, JB_X22<<3) + cfi_offset (x23, JB_X23<<3) + cfi_offset (x24, JB_X24<<3) + cfi_offset (x25, JB_X25<<3) + cfi_offset (x26, JB_X26<<3) + cfi_offset (x27, JB_X27<<3) + cfi_offset (x28, JB_X28<<3) + cfi_offset (x29, JB_X29<<3) + cfi_offset (x30, JB_LR<<3) + + cfi_offset ( d8, JB_D8<<3) + cfi_offset ( d9, JB_D9<<3) + cfi_offset (d10, JB_D10<<3) + cfi_offset (d11, JB_D11<<3) + cfi_offset (d12, JB_D12<<3) + cfi_offset (d13, JB_D13<<3) + cfi_offset (d14, JB_D14<<3) + cfi_offset (d15, JB_D15<<3) + ldp x19, x20, [x0, #JB_X19<<3] ldp x21, x22, [x0, #JB_X21<<3] ldp x23, x24, [x0, #JB_X23<<3] |