This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 3/3] xtensa: fix _Unwind_GetCFA
- From: Max Filippov <jcmvbkbc at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: linux-xtensa at linux-xtensa dot org, Sterling Augustine <augustine dot sterling at gmail dot com>, Max Filippov <jcmvbkbc at gmail dot com>
- Date: Tue, 18 Aug 2015 00:59:50 +0300
- Subject: [PATCH 3/3] xtensa: fix _Unwind_GetCFA
- Authentication-results: sourceware.org; auth=none
- References: <1439848790-3488-1-git-send-email-jcmvbkbc at gmail dot com>
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.
---
libgcc/config/xtensa/unwind-dw2-xtensa.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libgcc/config/xtensa/unwind-dw2-xtensa.c b/libgcc/config/xtensa/unwind-dw2-xtensa.c
index 82b0e63..8e579c7 100644
--- a/libgcc/config/xtensa/unwind-dw2-xtensa.c
+++ b/libgcc/config/xtensa/unwind-dw2-xtensa.c
@@ -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. */
--
1.8.1.4