This patch adjusts the fix for
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61771 to extract the last
PC from the stack frame if no valid FP is available for ARM.
From 6dc6e4f761080cf19a161fb0e27c1fd584688f40 Mon Sep 17 00:00:00 2001
From: Maxim Ostapenko <m.ostape...@samsung.com>
Date: Tue, 25 Oct 2016 20:27:37 +0300
Subject: [PATCH 3/7] libsanitizer/
* sanitizer_common/sanitizer_stacktrace.cc (GetCanonicFrame): Assume we
compiled code with GCC when extracting the caller PC for ARM if no
valid frame pointer is available.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229115 138bc75d-0d04-0410-961f-82ee72b054a4
---
libsanitizer/ChangeLog | 6 ++++++
libsanitizer/sanitizer_common/sanitizer_stacktrace.cc | 4 ++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog
index 10b1207..7e4f89f 100644
--- a/libsanitizer/ChangeLog
+++ b/libsanitizer/ChangeLog
@@ -1,5 +1,11 @@
2016-11-07 Maxim Ostapenko <m.ostape...@samsung.com>
+ * sanitizer_common/sanitizer_stacktrace.cc (GetCanonicFrame): Assume we
+ compiled code with GCC when extracting the caller PC for ARM if no
+ valid frame pointer is available.
+
+2016-11-07 Maxim Ostapenko <m.ostape...@samsung.com>
+
PR sanitizer/63958
Reapply:
2014-10-14 David S. Miller <da...@davemloft.net>
diff --git a/libsanitizer/sanitizer_common/sanitizer_stacktrace.cc b/libsanitizer/sanitizer_common/sanitizer_stacktrace.cc
index 531f256..cbb3af2 100644
--- a/libsanitizer/sanitizer_common/sanitizer_stacktrace.cc
+++ b/libsanitizer/sanitizer_common/sanitizer_stacktrace.cc
@@ -55,8 +55,8 @@ static inline uhwptr *GetCanonicFrame(uptr bp,
// Nope, this does not look right either. This means the frame after next does
// not have a valid frame pointer, but we can still extract the caller PC.
// Unfortunately, there is no way to decide between GCC and LLVM frame
- // layouts. Assume LLVM.
- return bp_prev;
+ // layouts. Assume GCC.
+ return bp_prev - 1;
#else
return (uhwptr*)bp;
#endif
--
1.9.1