[RS6000] libgcc cfi
There are a few places in libgcc assembly where we don't emit call frame information for functions, potentially breaking unwinding from asynchronous signal handlers. This patch fixes them. Although I patch tramp.S there is no attempt made to provide CFI for the actual trampoline on the stack. Doing that would require generating CFI at run time and both registering and deregistering it, which is probably not worth doing since it would significantly slow down the call. * config/rs6000/morestack.S (__stack_split_initialize), (__morestack_get_guard, __morestack_set_guard), (__morestack_make_guard): Provide CFI covering these functions. * config/rs6000/tramp.S (__trampoline_setup): Likewise. From-SVN: r266503
This commit is contained in:
parent
28a095763f
commit
1ea7ea181d
|
@ -1,3 +1,10 @@
|
||||||
|
2018-11-27 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
* config/rs6000/morestack.S (__stack_split_initialize),
|
||||||
|
(__morestack_get_guard, __morestack_set_guard),
|
||||||
|
(__morestack_make_guard): Provide CFI covering these functions.
|
||||||
|
* config/rs6000/tramp.S (__trampoline_setup): Likewise.
|
||||||
|
|
||||||
2018-11-15 Xianmiao Qu <xianmiao_qu@c-sky.com>
|
2018-11-15 Xianmiao Qu <xianmiao_qu@c-sky.com>
|
||||||
|
|
||||||
* config/csky/linux-unwind.h (sc_pt_regs): Update for kernel.
|
* config/csky/linux-unwind.h (sc_pt_regs): Update for kernel.
|
||||||
|
|
|
@ -304,12 +304,15 @@ DW.ref.__gcc_personality_v0:
|
||||||
# new thread starts. This is called from a constructor.
|
# new thread starts. This is called from a constructor.
|
||||||
# void __stack_split_initialize (void)
|
# void __stack_split_initialize (void)
|
||||||
ENTRY(__stack_split_initialize)
|
ENTRY(__stack_split_initialize)
|
||||||
|
.cfi_startproc
|
||||||
addi %r3,%r1,-0x4000 # We should have at least 16K.
|
addi %r3,%r1,-0x4000 # We should have at least 16K.
|
||||||
std %r3,-0x7000-64(%r13) # tcbhead_t.__private_ss
|
std %r3,-0x7000-64(%r13) # tcbhead_t.__private_ss
|
||||||
# void __generic_morestack_set_initial_sp (void *sp, size_t len)
|
# void __generic_morestack_set_initial_sp (void *sp, size_t len)
|
||||||
mr %r3,%r1
|
mr %r3,%r1
|
||||||
li %r4, 0x4000
|
li %r4, 0x4000
|
||||||
b __generic_morestack_set_initial_sp
|
b __generic_morestack_set_initial_sp
|
||||||
|
# The lack of .cfi_endproc here is deliberate. This function and the
|
||||||
|
# following ones can all use the default FDE.
|
||||||
SIZE (__stack_split_initialize)
|
SIZE (__stack_split_initialize)
|
||||||
|
|
||||||
|
|
||||||
|
@ -335,6 +338,7 @@ ENTRY0(__morestack_make_guard)
|
||||||
sub %r3,%r3,%r4
|
sub %r3,%r3,%r4
|
||||||
addi %r3,%r3,BACKOFF
|
addi %r3,%r3,BACKOFF
|
||||||
blr
|
blr
|
||||||
|
.cfi_endproc
|
||||||
SIZE (__morestack_make_guard)
|
SIZE (__morestack_make_guard)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -56,8 +56,10 @@ trampoline_size = .-trampoline_initial
|
||||||
/* R6 = static chain */
|
/* R6 = static chain */
|
||||||
|
|
||||||
FUNC_START(__trampoline_setup)
|
FUNC_START(__trampoline_setup)
|
||||||
|
.cfi_startproc
|
||||||
mflr r0 /* save return address */
|
mflr r0 /* save return address */
|
||||||
bcl 20,31,.LCF0 /* load up __trampoline_initial into r7 */
|
bcl 20,31,.LCF0 /* load up __trampoline_initial into r7 */
|
||||||
|
.cfi_register lr,r0
|
||||||
.LCF0:
|
.LCF0:
|
||||||
mflr r11
|
mflr r11
|
||||||
addi r7,r11,trampoline_initial-4-.LCF0 /* trampoline address -4 */
|
addi r7,r11,trampoline_initial-4-.LCF0 /* trampoline address -4 */
|
||||||
|
@ -112,6 +114,7 @@ FUNC_START(__trampoline_setup)
|
||||||
addi r30,r30,_GLOBAL_OFFSET_TABLE_-1b@l
|
addi r30,r30,_GLOBAL_OFFSET_TABLE_-1b@l
|
||||||
#endif
|
#endif
|
||||||
bl JUMP_TARGET(abort)
|
bl JUMP_TARGET(abort)
|
||||||
|
.cfi_endproc
|
||||||
FUNC_END(__trampoline_setup)
|
FUNC_END(__trampoline_setup)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -144,6 +147,7 @@ trampoline_size = .-trampoline_initial
|
||||||
.popsection
|
.popsection
|
||||||
|
|
||||||
FUNC_START(__trampoline_setup)
|
FUNC_START(__trampoline_setup)
|
||||||
|
.cfi_startproc
|
||||||
addis 7,2,.LC0@toc@ha
|
addis 7,2,.LC0@toc@ha
|
||||||
ld 7,.LC0@toc@l(7) /* trampoline address -8 */
|
ld 7,.LC0@toc@l(7) /* trampoline address -8 */
|
||||||
|
|
||||||
|
@ -180,6 +184,7 @@ FUNC_START(__trampoline_setup)
|
||||||
.Labort:
|
.Labort:
|
||||||
bl JUMP_TARGET(abort)
|
bl JUMP_TARGET(abort)
|
||||||
nop
|
nop
|
||||||
|
.cfi_endproc
|
||||||
FUNC_END(__trampoline_setup)
|
FUNC_END(__trampoline_setup)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue