diff options
author | Kewen Lin <linkw@linux.ibm.com> | 2023-03-08 00:57:21 -0600 |
---|---|---|
committer | Kewen Lin <linkw@linux.ibm.com> | 2023-03-08 00:57:21 -0600 |
commit | 15b83b69ca99d97643075776ba94f2dd1f05b46e (patch) | |
tree | 38356a5d8d2b0fd08fbfe8ab77ce8b003ed3e1c8 /gcc | |
parent | 2a2a159f7bd9d929ce457937f669ed2dd6ebccec (diff) | |
download | gcc-15b83b69ca99d97643075776ba94f2dd1f05b46e.zip gcc-15b83b69ca99d97643075776ba94f2dd1f05b46e.tar.gz gcc-15b83b69ca99d97643075776ba94f2dd1f05b46e.tar.bz2 |
libgcc, rs6000: Fix bump size for powerpc64 elfv1 ABI [PR108727]
As PR108727 shows, when cleanup code called by the stack
unwinder calls function _Unwind_Resume, it goes via plt
stub like:
function 00000000.plt_call._Unwind_Resume:
=> 0x0000000010003580 <+0>: std r2,40(r1)
0x0000000010003584 <+4>: ld r12,-31760(r2)
0x0000000010003588 <+8>: mtctr r12
0x000000001000358c <+12>: ld r2,-31752(r2)
0x0000000010003590 <+16>: cmpldi r2,0
0x0000000010003594 <+20>: bnectr+
0x0000000010003598 <+24>: b 0x100031a4
<_Unwind_Resume@plt>
It wants to save TOC base (r2) to r1 + 40, but we only
bump the stack segment by 32 bytes as follows:
stdu %r29,-32(%r3)
It means the access is out of the stack segment allocated
by __generic_morestack, once the touch area isn't writable
like this failure shows, it would cause segment fault.
So fix the bump size with one reasonable value PARAMS.
PR libgcc/108727
libgcc/ChangeLog:
* config/rs6000/morestack.S (__morestack): Use PARAMS for new stack
bump size.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions