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
This commit is contained in:
Alexey Merzlyakov 2014-05-16 13:16:33 +00:00 committed by Alexey Merzlyakov
parent 52264dbf66
commit 2a2794f7be
2 changed files with 17 additions and 5 deletions

View File

@ -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

View File

@ -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