diff options
author | Michal Meloun <mmel@FreeBSD.org> | 2018-02-27 15:35:11 +0000 |
---|---|---|
committer | Michal Meloun <mmel@FreeBSD.org> | 2018-02-27 15:35:11 +0000 |
commit | fad101b3f27e7fde7fa63da5817eecfa6354adf0 (patch) | |
tree | e61a6be05585e05fc8ab37e2c2ff3f2e9deb3fa1 /libexec/rtld-elf | |
parent | 81cb170feab583708ef1d19ea943e3c5023cf715 (diff) | |
download | src-fad101b3f27e7fde7fa63da5817eecfa6354adf0.tar.gz src-fad101b3f27e7fde7fa63da5817eecfa6354adf0.zip |
Make rtld_bind_start() debugger friendly.
Save link register and annotate call frame structure so debugger can unwind
call frame created by rtld_bind_start().
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=330073
Diffstat (limited to 'libexec/rtld-elf')
-rw-r--r-- | libexec/rtld-elf/aarch64/rtld_start.S | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/libexec/rtld-elf/aarch64/rtld_start.S b/libexec/rtld-elf/aarch64/rtld_start.S index 41397f944911..b9577dfccd75 100644 --- a/libexec/rtld-elf/aarch64/rtld_start.S +++ b/libexec/rtld-elf/aarch64/rtld_start.S @@ -55,7 +55,15 @@ END(.rtld_start) * x17 = &_rtld_bind_start */ ENTRY(_rtld_bind_start) + .cfi_startproc mov x17, sp + + /* Save frame pointer and SP */ + stp x29, x30, [sp, #-16]! + mov x29, sp + .cfi_def_cfa x29, 16 + .cfi_offset x30, -8 + .cfi_offset x29, -16 /* Save the arguments */ stp x0, x1, [sp, #-16]! @@ -84,9 +92,6 @@ ENTRY(_rtld_bind_start) /* Call into rtld */ bl _rtld_bind - /* Restore the registers saved by the plt code */ - ldp xzr, x30, [sp, #(5 * 16 + 4 * 32)] - /* Backup the address to branch to */ mov x16, x0 @@ -100,11 +105,16 @@ ENTRY(_rtld_bind_start) ldp x4, x5, [sp], #16 ldp x2, x3, [sp], #16 ldp x0, x1, [sp], #16 - /* And the part of the stack the plt entry handled */ - add sp, sp, #16 + + /* Restore frame pointer */ + ldp x29, xzr, [sp], #16 + + /* Restore link register saved by the plt code */ + ldp xzr, x30, [sp], #16 /* Call into the correct function */ br x16 + .cfi_endproc END(_rtld_bind_start) /* |