summaryrefslogtreecommitdiff
path: root/patches/gcc/linaro-4.9-2017.01/873-xtensa-fix-_Unwind_GetCFA.patch
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2017-02-28 19:08:24 (GMT)
committerGitHub <noreply@github.com>2017-02-28 19:08:24 (GMT)
commitc8b355ea925cfea1f6ff00e2edef4f0afa0f76a7 (patch)
treeee8b04c33cf0797e985d0f5476d310e9abb8ba78 /patches/gcc/linaro-4.9-2017.01/873-xtensa-fix-_Unwind_GetCFA.patch
parented7e671013eae3ffa7e683de9470b5cf80d3cb4f (diff)
parent99283866cc84102f22324a751a2ba3afb9221cb6 (diff)
Merge pull request #622 from stilor/missing-linaro-patches
Add patches to Linaro GCC
Diffstat (limited to 'patches/gcc/linaro-4.9-2017.01/873-xtensa-fix-_Unwind_GetCFA.patch')
-rw-r--r--patches/gcc/linaro-4.9-2017.01/873-xtensa-fix-_Unwind_GetCFA.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/patches/gcc/linaro-4.9-2017.01/873-xtensa-fix-_Unwind_GetCFA.patch b/patches/gcc/linaro-4.9-2017.01/873-xtensa-fix-_Unwind_GetCFA.patch
new file mode 100644
index 0000000..dc40513
--- /dev/null
+++ b/patches/gcc/linaro-4.9-2017.01/873-xtensa-fix-_Unwind_GetCFA.patch
@@ -0,0 +1,40 @@
+From 15c7c4d39b317f0d902ef28fd43eca5c3369f891 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Sat, 15 Aug 2015 05:12:11 +0300
+Subject: [PATCH 3/3] 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.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+Backported from: r226964
+
+ 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 35f7797..ef6b900 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
+