diff options
author | Alexey Merzlyakov <alexey.merzlyakov@samsung.com> | 2014-05-16 13:16:33 +0000 |
---|---|---|
committer | Alexey Merzlyakov <merzlyakovao@gcc.gnu.org> | 2014-05-16 13:16:33 +0000 |
commit | 2a2794f7be141f318d216fc9cb16181383deacf5 (patch) | |
tree | 31231d2e265a1a944d68c15930d108117e482bf2 /libstdc++-v3 | |
parent | 52264dbf66412429f6967c304ccf81a9c3ffeed5 (diff) | |
download | gcc-2a2794f7be141f318d216fc9cb16181383deacf5.zip gcc-2a2794f7be141f318d216fc9cb16181383deacf5.tar.gz gcc-2a2794f7be141f318d216fc9cb16181383deacf5.tar.bz2 |
re PR libstdc++/60758 (Infinite backtrace in __cxa_end_cleanup)
2014-05-16 Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
PR libstdc++/60758
* libsupc++/eh_arm.cc (__cxa_end_cleanup): Change r4 to lr in save/restore
and add unwind directives.
From-SVN: r210515
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 6 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/eh_arm.cc | 16 |
2 files changed, 17 insertions, 5 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 3df0901..1e7d84e 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2014-05-16 Alexey Merzlyakov <alexey.merzlyakov@samsung.com> + + PR libstdc++/60758 + * libsupc++/eh_arm.cc (__cxa_end_cleanup): Change r4 to lr in save/restore + and add unwind directives. + 2014-05-16 Jonathan Wakely <jwakely@redhat.com> * include/bits/parse_numbers.h (__parse_int::_Number_help): Check for diff --git a/libstdc++-v3/libsupc++/eh_arm.cc b/libstdc++-v3/libsupc++/eh_arm.cc index aa453dd..6a45af5 100644 --- a/libstdc++-v3/libsupc++/eh_arm.cc +++ b/libstdc++-v3/libsupc++/eh_arm.cc @@ -199,27 +199,33 @@ asm (".global __cxa_end_cleanup\n" " nop 5\n"); #else // Assembly wrapper to call __gnu_end_cleanup without clobbering r1-r3. -// Also push r4 to preserve stack alignment. +// Also push lr to preserve stack alignment and to allow backtracing. #ifdef __thumb__ asm (" .pushsection .text.__cxa_end_cleanup\n" " .global __cxa_end_cleanup\n" " .type __cxa_end_cleanup, \"function\"\n" " .thumb_func\n" "__cxa_end_cleanup:\n" -" push\t{r1, r2, r3, r4}\n" +" .fnstart\n" +" push\t{r1, r2, r3, lr}\n" +" .save\t{r1, r2, r3, lr}\n" " bl\t__gnu_end_cleanup\n" -" pop\t{r1, r2, r3, r4}\n" +" pop\t{r1, r2, r3, lr}\n" " bl\t_Unwind_Resume @ Never returns\n" +" .fnend\n" " .popsection\n"); #else asm (" .pushsection .text.__cxa_end_cleanup\n" " .global __cxa_end_cleanup\n" " .type __cxa_end_cleanup, \"function\"\n" "__cxa_end_cleanup:\n" -" stmfd\tsp!, {r1, r2, r3, r4}\n" +" .fnstart\n" +" stmfd\tsp!, {r1, r2, r3, lr}\n" +" .save\t{r1, r2, r3, lr}\n" " bl\t__gnu_end_cleanup\n" -" ldmfd\tsp!, {r1, r2, r3, r4}\n" +" ldmfd\tsp!, {r1, r2, r3, lr}\n" " bl\t_Unwind_Resume @ Never returns\n" +" .fnend\n" " .popsection\n"); #endif #endif |