]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
xtensa: fix _Unwind_GetCFA
authorMax Filippov <jcmvbkbc@gmail.com>
Tue, 30 May 2017 23:32:21 +0000 (23:32 +0000)
committerMax Filippov <jcmvbkbc@gcc.gnu.org>
Tue, 30 May 2017 23:32:21 +0000 (23:32 +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.

2017-05-30  Max Filippov  <jcmvbkbc@gmail.com>
libgcc/
Backport from mainline
2015-08-18  Max Filippov  <jcmvbkbc@gmail.com>

* config/xtensa/unwind-dw2-xtensa.c (_Unwind_GetCFA): Return
context->sp instead of context->cfa.

From-SVN: r248703

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

index 8f8e7e34ecfa35f398ad70bf8e3317658a391ffc..c9b698f3799d62f64aa71f45b470cf7d9e095eca 100644 (file)
@@ -1,3 +1,11 @@
+2017-05-30  Max Filippov  <jcmvbkbc@gmail.com>
+
+       Backport from mainline
+       2015-08-18  Max Filippov  <jcmvbkbc@gmail.com>
+
+       * config/xtensa/unwind-dw2-xtensa.c (_Unwind_GetCFA): Return
+       context->sp instead of context->cfa.
+
 2017-05-30  Max Filippov  <jcmvbkbc@gmail.com>
 
        Backport from mainline
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.  */