Commit 991995c4 by Max Filippov Committed by Max Filippov

xtensa: fix _Unwind_GetCFA

Returning context->cfa in _Unwind_GetCFA makes CFA point one stack frame
higher than what was actually used by code at context->ra. This results
in invalid CFA value in signal frames and premature unwinding completion
in forced unwinding used by uClibc NPTL thread cancellation.
Returning context->sp from _Unwind_GetCFA makes all CFA values valid and
matching code that used them.

2015-08-18  Max Filippov  <jcmvbkbc@gmail.com>
libgcc/
	* config/xtensa/unwind-dw2-xtensa.c (_Unwind_GetCFA): Return
	context->sp instead of context->cfa.

From-SVN: r226964
parent 0e19db59
2015-08-18 Max Filippov <jcmvbkbc@gmail.com> 2015-08-18 Max Filippov <jcmvbkbc@gmail.com>
* config/xtensa/unwind-dw2-xtensa.c (_Unwind_GetCFA): Return
context->sp instead of context->cfa.
2015-08-18 Max Filippov <jcmvbkbc@gmail.com>
* config/xtensa/t-windowed (LIB2ADDEH): Replace unwind-dw2-fde * config/xtensa/t-windowed (LIB2ADDEH): Replace unwind-dw2-fde
with unwind-dw2-fde-dip. with unwind-dw2-fde-dip.
......
...@@ -130,7 +130,7 @@ _Unwind_GetGR (struct _Unwind_Context *context, int index) ...@@ -130,7 +130,7 @@ _Unwind_GetGR (struct _Unwind_Context *context, int index)
_Unwind_Word _Unwind_Word
_Unwind_GetCFA (struct _Unwind_Context *context) _Unwind_GetCFA (struct _Unwind_Context *context)
{ {
return (_Unwind_Ptr) context->cfa; return (_Unwind_Ptr) context->sp;
} }
/* Overwrite the saved value for register INDEX in CONTEXT with VAL. */ /* Overwrite the saved value for register INDEX in CONTEXT with VAL. */
......
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