diff options
author | Tim Shen <timshen91@gmail.com> | 2017-05-17 21:20:00 +0000 |
---|---|---|
committer | Tim Shen <timshen91@gmail.com> | 2017-05-17 21:20:00 +0000 |
commit | af3ffcc1f8d13b2b5f26e8283df25dd05ea1a3f0 (patch) | |
tree | fc32029872387ac9888e3dc7edb4f478cb884597 /compiler-rt/lib/xray | |
parent | 156d3ae0b686037ab00e33eea5bd2d16762e371c (diff) | |
download | bcm5719-llvm-af3ffcc1f8d13b2b5f26e8283df25dd05ea1a3f0.tar.gz bcm5719-llvm-af3ffcc1f8d13b2b5f26e8283df25dd05ea1a3f0.zip |
[XRay] Fix __xray_function_address on PPC reguarding local entry points.
Reviewers: echristo, dberris
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D33266
llvm-svn: 303302
Diffstat (limited to 'compiler-rt/lib/xray')
-rw-r--r-- | compiler-rt/lib/xray/xray_interface.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler-rt/lib/xray/xray_interface.cc b/compiler-rt/lib/xray/xray_interface.cc index c437a72e3f0..523ed16b9e1 100644 --- a/compiler-rt/lib/xray/xray_interface.cc +++ b/compiler-rt/lib/xray/xray_interface.cc @@ -326,7 +326,14 @@ uintptr_t __xray_function_address(int32_t FuncId) XRAY_NEVER_INSTRUMENT { __sanitizer::SpinMutexLock Guard(&XRayInstrMapMutex); if (FuncId <= 0 || static_cast<size_t>(FuncId) > XRayInstrMap.Functions) return 0; - return XRayInstrMap.SledsIndex[FuncId - 1].Begin->Address; + return XRayInstrMap.SledsIndex[FuncId - 1].Begin->Address +// On PPC, function entries are always aligned to 16 bytes. The beginning of a +// sled might be a local entry, which is always +8 based on the global entry. +// Always return the global entry. +#ifdef __PPC__ + & ~0xf +#endif + ; } size_t __xray_max_function_id() XRAY_NEVER_INSTRUMENT { |