summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorAlex Shlyapnikov <alekseys@google.com>2018-04-24 00:16:54 +0000
committerAlex Shlyapnikov <alekseys@google.com>2018-04-24 00:16:54 +0000
commit909fb12f0ceb2822f0a27d31049b3cc7ec874adb (patch)
tree0a2645073ee2c31a93a17a7c49a28de9ac2525ff /llvm/lib/Transforms
parentab7578460b9ee854c06fb837cfd6dc4076ece146 (diff)
downloadbcm5719-llvm-909fb12f0ceb2822f0a27d31049b3cc7ec874adb.tar.gz
bcm5719-llvm-909fb12f0ceb2822f0a27d31049b3cc7ec874adb.zip
[HWASan] Use dynamic shadow memory on Android only (LLVM)
There're issues with IFUNC support on other platforms. DIfferential Revision: https://reviews.llvm.org/D45840 llvm-svn: 330665
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
index e0bdf564df8..55bdda3eb1a 100644
--- a/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
@@ -737,19 +737,17 @@ bool HWAddressSanitizer::runOnFunction(Function &F) {
void HWAddressSanitizer::ShadowMapping::init(Triple &TargetTriple) {
const bool IsAndroid = TargetTriple.isAndroid();
- const bool IsLinux = TargetTriple.isOSLinux();
- const bool IsX86_64 = TargetTriple.getArch() == Triple::x86_64;
const bool IsAndroidWithIfuncSupport =
IsAndroid && !TargetTriple.isAndroidVersionLT(21);
Scale = kDefaultShadowScale;
- if (ClEnableKhwasan || ClInstrumentWithCalls || IsX86_64)
+ if (ClEnableKhwasan || ClInstrumentWithCalls || !IsAndroidWithIfuncSupport)
Offset = 0;
else
Offset = kDynamicShadowSentinel;
if (ClMappingOffset.getNumOccurrences() > 0)
Offset = ClMappingOffset;
- InGlobal = (IsX86_64 && IsLinux) || IsAndroidWithIfuncSupport;
+ InGlobal = IsAndroidWithIfuncSupport;
}
OpenPOWER on IntegriCloud