[PATCH] D30426: [AddressSanitizer] Put shadow at 0 for Fuchsia

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 27 15:01:34 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL296405: [AddressSanitizer] Put shadow at 0 for Fuchsia (authored by phosek).

Changed prior to commit:
  https://reviews.llvm.org/D30426?vs=89916&id=89943#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D30426

Files:
  llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp


Index: llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -394,6 +394,7 @@
                   TargetTriple.getArch() == llvm::Triple::mips64el;
   bool IsAArch64 = TargetTriple.getArch() == llvm::Triple::aarch64;
   bool IsWindows = TargetTriple.isOSWindows();
+  bool IsFuchsia = TargetTriple.isOSFuchsia();
 
   ShadowMapping Mapping;
 
@@ -414,7 +415,11 @@
     else
       Mapping.Offset = kDefaultShadowOffset32;
   } else {  // LongSize == 64
-    if (IsPPC64)
+    // Fuchsia is always PIE, which means that the beginning of the address
+    // space is always available.
+    if (IsFuchsia)
+      Mapping.Offset = 0;
+    else if (IsPPC64)
       Mapping.Offset = kPPC64_ShadowOffset64;
     else if (IsSystemZ)
       Mapping.Offset = kSystemZ_ShadowOffset64;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30426.89943.patch
Type: text/x-patch
Size: 987 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170227/10700791/attachment.bin>


More information about the llvm-commits mailing list