aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-12-11 06:24:52 +0000
committerBill Wendling <isanbard@gmail.com>2013-12-11 06:24:52 +0000
commit24861607cb3c606ad46e724456eb851558c85330 (patch)
treefb908b0ed5ba2571140115446a595df22d8b3d2a
parent2bbe0d1429a46cb93aafc055de6a8f1b5433e454 (diff)
downloadcompiler-rt-24861607cb3c606ad46e724456eb851558c85330.tar.gz
Merging r196802:
------------------------------------------------------------------------ r196802 | chandlerc | 2013-12-09 11:25:51 -0800 (Mon, 09 Dec 2013) | 11 lines Revert three patches which were committed without explicit contribution by their authors. This may break builds where others added code relying on these patches, but please *do not* revert this commit. Instead, we will prepare patches which fix the failures. Reverts the following commits: r168306: "[asan] support x32 mode in the fast stack unwinder. Patch by H.J. Lu" r168356: "[asan] more support for powerpc, patch by Peter Bergner" r196489: "[sanitizer] fix the ppc32 build (patch by Jakub Jelinek)" ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/branches/release_34@197011 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/asan/asan_linux.cc7
-rw-r--r--lib/asan/asan_mapping.h5
-rw-r--r--lib/sanitizer_common/sanitizer_common.h4
-rw-r--r--lib/sanitizer_common/sanitizer_internal_defs.h7
-rw-r--r--lib/sanitizer_common/sanitizer_stacktrace.cc27
-rw-r--r--lib/sanitizer_common/sanitizer_stacktrace.h1
6 files changed, 9 insertions, 42 deletions
diff --git a/lib/asan/asan_linux.cc b/lib/asan/asan_linux.cc
index 39eec3bfd..a500f978e 100644
--- a/lib/asan/asan_linux.cc
+++ b/lib/asan/asan_linux.cc
@@ -74,13 +74,6 @@ void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) {
*pc = ucontext->uc_mcontext.gregs[REG_EIP];
*bp = ucontext->uc_mcontext.gregs[REG_EBP];
*sp = ucontext->uc_mcontext.gregs[REG_ESP];
-# elif defined(__powerpc__) || defined(__powerpc64__)
- ucontext_t *ucontext = (ucontext_t*)context;
- *pc = ucontext->uc_mcontext.regs->nip;
- *sp = ucontext->uc_mcontext.regs->gpr[PT_R1];
- // The powerpc{,64}-linux ABIs do not specify r31 as the frame
- // pointer, but GCC always uses r31 when we need a frame pointer.
- *bp = ucontext->uc_mcontext.regs->gpr[PT_R31];
# elif defined(__sparc__)
ucontext_t *ucontext = (ucontext_t*)context;
uptr *stk_ptr;
diff --git a/lib/asan/asan_mapping.h b/lib/asan/asan_mapping.h
index 1fecaeb35..950fb9ce1 100644
--- a/lib/asan/asan_mapping.h
+++ b/lib/asan/asan_mapping.h
@@ -61,7 +61,6 @@ static const u64 kDefaultShadowScale = 3;
static const u64 kDefaultShadowOffset32 = 1ULL << 29;
static const u64 kDefaultShadowOffset64 = 1ULL << 44;
static const u64 kDefaultShort64bitShadowOffset = 0x7FFF8000; // < 2G.
-static const u64 kPPC64_ShadowOffset64 = 1ULL << 41;
static const u64 kMIPS32_ShadowOffset32 = 0x0aaa8000;
#if ASAN_FLEXIBLE_MAPPING_AND_OFFSET == 1
@@ -81,9 +80,7 @@ extern SANITIZER_INTERFACE_ATTRIBUTE uptr __asan_mapping_offset;
# define SHADOW_OFFSET kDefaultShadowOffset32
# endif
# else
-# if defined(__powerpc64__)
-# define SHADOW_OFFSET kPPC64_ShadowOffset64
-# elif SANITIZER_MAC
+# if SANITIZER_MAC
# define SHADOW_OFFSET kDefaultShadowOffset64
# else
# define SHADOW_OFFSET kDefaultShort64bitShadowOffset
diff --git a/lib/sanitizer_common/sanitizer_common.h b/lib/sanitizer_common/sanitizer_common.h
index cf8a12d65..6d00483df 100644
--- a/lib/sanitizer_common/sanitizer_common.h
+++ b/lib/sanitizer_common/sanitizer_common.h
@@ -27,11 +27,7 @@ struct StackTrace;
const uptr kWordSize = SANITIZER_WORDSIZE / 8;
const uptr kWordSizeInBits = 8 * kWordSize;
-#if defined(__powerpc__) || defined(__powerpc64__)
-const uptr kCacheLineSize = 128;
-#else
const uptr kCacheLineSize = 64;
-#endif
const uptr kMaxPathLength = 512;
diff --git a/lib/sanitizer_common/sanitizer_internal_defs.h b/lib/sanitizer_common/sanitizer_internal_defs.h
index daa724be0..df676de3e 100644
--- a/lib/sanitizer_common/sanitizer_internal_defs.h
+++ b/lib/sanitizer_common/sanitizer_internal_defs.h
@@ -58,13 +58,6 @@ typedef signed long long sptr; // NOLINT
typedef unsigned long uptr; // NOLINT
typedef signed long sptr; // NOLINT
#endif // defined(_WIN64)
-#if defined(__x86_64__)
-// Since x32 uses ILP32 data model in 64-bit hardware mode, we must use
-// 64-bit pointer to unwind stack frame.
-typedef unsigned long long uhwptr; // NOLINT
-#else
-typedef uptr uhwptr; // NOLINT
-#endif
typedef unsigned char u8;
typedef unsigned short u16; // NOLINT
typedef unsigned int u32;
diff --git a/lib/sanitizer_common/sanitizer_stacktrace.cc b/lib/sanitizer_common/sanitizer_stacktrace.cc
index de16becca..cbb15533b 100644
--- a/lib/sanitizer_common/sanitizer_stacktrace.cc
+++ b/lib/sanitizer_common/sanitizer_stacktrace.cc
@@ -24,10 +24,7 @@ uptr StackTrace::GetPreviousInstructionPc(uptr pc) {
// Cancel Thumb bit.
pc = pc & (~1);
#endif
-#if defined(__powerpc__) || defined(__powerpc64__)
- // PCs are always 4 byte aligned.
- return pc - 4;
-#elif defined(__sparc__)
+#if defined(__sparc__)
return pc - 8;
#else
return pc - 1;
@@ -128,29 +125,21 @@ void StackTrace::FastUnwindStack(uptr pc, uptr bp,
}
trace[0] = pc;
size = 1;
- uhwptr *frame = (uhwptr *)bp;
- uhwptr *prev_frame = frame - 1;
+ uptr *frame = (uptr *)bp;
+ uptr *prev_frame = frame - 1;
if (stack_top < 4096) return; // Sanity check for stack top.
// Avoid infinite loop when frame == frame[0] by using frame > prev_frame.
while (frame > prev_frame &&
- frame < (uhwptr *)stack_top - 2 &&
- frame > (uhwptr *)stack_bottom &&
+ frame < (uptr *)stack_top - 2 &&
+ frame > (uptr *)stack_bottom &&
IsAligned((uptr)frame, sizeof(*frame)) &&
size < max_depth) {
- uhwptr pc1 = frame[1];
+ uptr pc1 = frame[1];
if (pc1 != pc) {
- trace[size++] = (uptr) pc1;
+ trace[size++] = pc1;
}
prev_frame = frame;
- frame = (uhwptr *)frame[0];
- }
-}
-
-void StackTrace::PopStackFrames(uptr count) {
- CHECK(size >= count);
- size -= count;
- for (uptr i = 0; i < size; i++) {
- trace[i] = trace[i + count];
+ frame = (uptr*)frame[0];
}
}
diff --git a/lib/sanitizer_common/sanitizer_stacktrace.h b/lib/sanitizer_common/sanitizer_stacktrace.h
index 5042f2301..7b1460bc4 100644
--- a/lib/sanitizer_common/sanitizer_stacktrace.h
+++ b/lib/sanitizer_common/sanitizer_stacktrace.h
@@ -68,7 +68,6 @@ struct StackTrace {
void FastUnwindStack(uptr pc, uptr bp, uptr stack_top, uptr stack_bottom,
uptr max_depth);
void SlowUnwindStack(uptr pc, uptr max_depth);
- void PopStackFrames(uptr count);
uptr LocatePcInTrace(uptr pc);
};