diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2014-05-30 08:52:03 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2014-05-30 08:52:03 +0000 |
commit | 148b68bf0bd538de63ac37ac6f752d34085db7de (patch) | |
tree | 887d6bbd6bbe2a89f203ec2c70f9ddec65158c11 /lib/asan/asan_linux.cc | |
parent | 8fe7d1b3b655c1f04358374dd197a624e9bf8286 (diff) |
[asan] Enable ASan on PowerPC.
Patch by Peter Bergner.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209879 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_linux.cc')
-rw-r--r-- | lib/asan/asan_linux.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/asan/asan_linux.cc b/lib/asan/asan_linux.cc index fce9d1cd5..07a031e48 100644 --- a/lib/asan/asan_linux.cc +++ b/lib/asan/asan_linux.cc @@ -188,6 +188,13 @@ void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) { *bp = ucontext->uc_mcontext.gregs[REG_EBP]; *sp = ucontext->uc_mcontext.gregs[REG_ESP]; # endif +#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; |