mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
csu: Add the prologue and epilogue to the _init and _fini on aarch64
Normally, modern unwinders uses Dwarf information to unwind stack, however in case when the code is not annotated by Dwarf instructions, unwinders fallbacks to a frame-pointer based algorithm. That is allows libunwind to unwind stack from global constructors and destructors. Also it makes gdb happy as it printed nonexistent frame before. Reviewed by: Differential Revision: https://reviews.freebsd.org/D40842
This commit is contained in:
parent
a2cc93ec7f
commit
43e29d03f4
|
@ -35,14 +35,14 @@ __FBSDID("$FreeBSD$");
|
|||
.globl _init
|
||||
.type _init,@function
|
||||
_init:
|
||||
sub sp, sp, #16
|
||||
str lr, [sp]
|
||||
stp x29, x30, [sp, #-16]!
|
||||
mov x29, sp
|
||||
|
||||
.section .fini,"ax",@progbits
|
||||
.align 4
|
||||
.globl _fini
|
||||
.type _fini,@function
|
||||
_fini:
|
||||
sub sp, sp, #16
|
||||
str lr, [sp]
|
||||
stp x29, x30, [sp, #-16]!
|
||||
mov x29, sp
|
||||
|
||||
|
|
|
@ -31,14 +31,12 @@
|
|||
__FBSDID("$FreeBSD$");
|
||||
|
||||
.section .init,"ax",@progbits
|
||||
ldr lr, [sp]
|
||||
add sp, sp, #16
|
||||
ldp x29, x30, [sp], #16
|
||||
ret
|
||||
|
||||
|
||||
.section .fini,"ax",@progbits
|
||||
ldr lr, [sp]
|
||||
add sp, sp, #16
|
||||
ldp x29, x30, [sp], #16
|
||||
ret
|
||||
|
||||
.section .note.GNU-stack,"",%progbits
|
||||
|
|
Loading…
Reference in a new issue