[compiler-rt] r243548 - [asan] Remove special case mapping on Android/AArch64.

Evgeniy Stepanov eugeni.stepanov at gmail.com
Wed Jul 29 11:22:26 PDT 2015


Author: eugenis
Date: Wed Jul 29 13:22:25 2015
New Revision: 243548

URL: http://llvm.org/viewvc/llvm-project?rev=243548&view=rev
Log:
[asan] Remove special case mapping on Android/AArch64.

ASan shadow on Android starts at address 0 for both historic and
performance reasons. This is possible because the platform mandates
-pie, which makes lower memory region always available.

This is not such a good idea on 64-bit platforms because of MAP_32BIT
incompatibility.

This patch changes Android/AArch64 mapping to be the same as that of
Linux/AAarch64.


Modified:
    compiler-rt/trunk/lib/asan/asan_mapping.h

Modified: compiler-rt/trunk/lib/asan/asan_mapping.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_mapping.h?rev=243548&r1=243547&r2=243548&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_mapping.h (original)
+++ compiler-rt/trunk/lib/asan/asan_mapping.h Wed Jul 29 13:22:25 2015
@@ -113,11 +113,12 @@ static const u64 kFreeBSD_ShadowOffset64
 static const u64 kWindowsShadowOffset32 = 3ULL << 28;  // 0x30000000
 
 #define SHADOW_SCALE kDefaultShadowScale
-#if SANITIZER_ANDROID
-# define SHADOW_OFFSET (0)
-#else
-# if SANITIZER_WORDSIZE == 32
-#  if defined(__mips__)
+
+
+#if SANITIZER_WORDSIZE == 32
+#  if SANITIZER_ANDROID
+#    define SHADOW_OFFSET (0)
+#  elif defined(__mips__)
 #    define SHADOW_OFFSET kMIPS32_ShadowOffset32
 #  elif SANITIZER_FREEBSD
 #    define SHADOW_OFFSET kFreeBSD_ShadowOffset32
@@ -130,7 +131,7 @@ static const u64 kWindowsShadowOffset32
 #  else
 #    define SHADOW_OFFSET kDefaultShadowOffset32
 #  endif
-# else
+#else
 #  if defined(__aarch64__)
 #    define SHADOW_OFFSET kAArch64_ShadowOffset64
 #  elif defined(__powerpc64__)
@@ -148,7 +149,6 @@ static const u64 kWindowsShadowOffset32
 #  else
 #   define SHADOW_OFFSET kDefaultShort64bitShadowOffset
 #  endif
-# endif
 #endif
 
 #define SHADOW_GRANULARITY (1ULL << SHADOW_SCALE)





More information about the llvm-commits mailing list