]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
xtensa: fix _Unwind_GetCFA
authorMax Filippov <jcmvbkbc@gmail.com>
Tue, 18 Aug 2015 01:08:22 +0000 (01:08 +0000)
committerMax Filippov <jcmvbkbc@gcc.gnu.org>
Tue, 18 Aug 2015 01:08:22 +0000 (01:08 +0000)
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

libgcc/ChangeLog
libgcc/config/xtensa/unwind-dw2-xtensa.c

index c186881ebcbbeeaa840b6062b3def1f5b3d2a3db..0d1acf302dfd188215d05b324858d53024283eee 100644 (file)
@@ -1,3 +1,8 @@
+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
index 82b0e6314b00338d2d1af8a0bf3258abfa088845..8e579c7617d34426124f196b6d27908343d366c2 100644 (file)
@@ -130,7 +130,7 @@ _Unwind_GetGR (struct _Unwind_Context *context, int index)
 _Unwind_Word
 _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.  */