Commit 2a2794f7 by Alexey Merzlyakov Committed by Alexey Merzlyakov

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
parent 52264dbf
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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment