summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2015-07-17 23:51:18 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2015-07-17 23:51:18 +0000
commit9cb08f823f270d31041112c47617a99d04d06fb2 (patch)
tree15c711220817f09a95051910272f518969aacf32 /llvm/lib
parente6c614d48a33a067b386d1a4a22bff5db982821e (diff)
downloadbcm5719-llvm-9cb08f823f270d31041112c47617a99d04d06fb2.tar.gz
bcm5719-llvm-9cb08f823f270d31041112c47617a99d04d06fb2.zip
[asan] Fix shadow mapping on Android/AArch64.
Instrumentation and the runtime library were in disagreement about ASan shadow offset on Android/AArch64. This fixes a large number of existing tests on Android/AArch64. llvm-svn: 242595
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
index a98439b6b39..52b2290a938 100644
--- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -337,10 +337,12 @@ static ShadowMapping getShadowMapping(Triple &TargetTriple, int LongSize,
ShadowMapping Mapping;
- if (LongSize == 32) {
- if (IsAndroid)
- Mapping.Offset = 0;
- else if (IsMIPS32)
+ if (IsAndroid) {
+ // Android is always PIE, which means that the beginning of the address
+ // space is always available.
+ Mapping.Offset = 0;
+ } else if (LongSize == 32) {
+ if (IsMIPS32)
Mapping.Offset = kMIPS32_ShadowOffset32;
else if (IsFreeBSD)
Mapping.Offset = kFreeBSD_ShadowOffset32;
OpenPOWER on IntegriCloud