[v2,5/6] x86-64: Use RBP instead of RBX as CFA register in _dl_tlsdesc_dynamic
Checks
| Context |
Check |
Description |
| redhat-pt-bot/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
| linaro-tcwg-bot/tcwg_glibc_build--master-arm |
success
|
Build passed
|
| linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 |
success
|
Build passed
|
| linaro-tcwg-bot/tcwg_glibc_check--master-arm |
success
|
Test passed
|
| linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 |
success
|
Test passed
|
Commit Message
The slow path of _dl_tlsdesc_dynamic realigns the stack and uses RBX as
the CFA register around the call to __tls_get_addr. As with the PLT
trampolines, unwinders that track only SP, FP and RA (SFrame, the Linux
kernel user-space unwinder, aw-backtrace) can use such a CFA only in
the topmost frame, so they cannot unwind out of __tls_get_addr.
Use RBP instead. The change is mechanical.
Signed-off-by: Aliaksei Kandratsenka <alkondratenko@gmail.com>
---
sysdeps/x86_64/dl-tlsdesc-dynamic.h | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
@@ -79,14 +79,14 @@ _dl_tlsdesc_dynamic:
movq -8(%rsp), %rdi
ret
2:
- movq %rbx, -24(%rsp)
- mov %RSP_LP, %RBX_LP
- cfi_def_cfa_register(%rbx)
+ movq %rbp, -24(%rsp)
+ mov %RSP_LP, %RBP_LP
+ cfi_def_cfa_register(%rbp)
and $-STATE_SAVE_ALIGNMENT, %RSP_LP
#ifdef REGISTER_SAVE_AREA
/* STATE_SAVE_OFFSET has space for 8 integer registers. But we
need space for RCX, RDX, RSI, RDI, R8, R9, R10 and R11, plus
- RBX above. */
+ RBP above. */
sub $(REGISTER_SAVE_AREA + STATE_SAVE_ALIGNMENT), %RSP_LP
#else
/* Allocate stack space of the required size to save the state. */
@@ -141,10 +141,10 @@ _dl_tlsdesc_dynamic:
movq REGISTER_SAVE_R8(%rsp), %r8
movq REGISTER_SAVE_RDX(%rsp), %rdx
movq REGISTER_SAVE_RCX(%rsp), %rcx
- mov %RBX_LP, %RSP_LP
+ mov %RBP_LP, %RSP_LP
cfi_def_cfa_register(%rsp)
- movq -24(%rsp), %rbx
- cfi_restore(%rbx)
+ movq -24(%rsp), %rbp
+ cfi_restore(%rbp)
jmp 1b
cfi_endproc
.size _dl_tlsdesc_dynamic, .-_dl_tlsdesc_dynamic