[llvm] r330665 - [HWASan] Use dynamic shadow memory on Android only (LLVM)

Alex Shlyapnikov via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 23 17:16:54 PDT 2018


Author: alekseyshl
Date: Mon Apr 23 17:16:54 2018
New Revision: 330665

URL: http://llvm.org/viewvc/llvm-project?rev=330665&view=rev
Log:
[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

Modified:
    llvm/trunk/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp

Modified: llvm/trunk/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp?rev=330665&r1=330664&r2=330665&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp Mon Apr 23 17:16:54 2018
@@ -737,19 +737,17 @@ bool HWAddressSanitizer::runOnFunction(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;
 }




More information about the llvm-commits mailing list