[llvm-commits] [compiler-rt] r157318 - /compiler-rt/trunk/lib/asan/asan_mapping.h
Evgeniy Stepanov
eugeni.stepanov at gmail.com
Wed May 23 04:52:37 PDT 2012
Author: eugenis
Date: Wed May 23 06:52:37 2012
New Revision: 157318
URL: http://llvm.org/viewvc/llvm-project?rev=157318&view=rev
Log:
Use zero-based shadow by default on Android.
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=157318&r1=157317&r2=157318&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_mapping.h (original)
+++ compiler-rt/trunk/lib/asan/asan_mapping.h Wed May 23 06:52:37 2012
@@ -22,15 +22,20 @@
#if ASAN_FLEXIBLE_MAPPING_AND_OFFSET == 1
extern __attribute__((visibility("default"))) uintptr_t __asan_mapping_scale;
extern __attribute__((visibility("default"))) uintptr_t __asan_mapping_offset;
-#define SHADOW_SCALE (__asan_mapping_scale)
-#define SHADOW_OFFSET (__asan_mapping_offset)
+# define SHADOW_SCALE (__asan_mapping_scale)
+# define SHADOW_OFFSET (__asan_mapping_offset)
#else
-#define SHADOW_SCALE (3)
-#if __WORDSIZE == 32
-#define SHADOW_OFFSET (1 << 29)
-#else
-#define SHADOW_OFFSET (1ULL << 44)
-#endif
+# ifdef ANDROID
+# define SHADOW_SCALE (3)
+# define SHADOW_OFFSET (0)
+# else
+# define SHADOW_SCALE (3)
+# if __WORDSIZE == 32
+# define SHADOW_OFFSET (1 << 29)
+# else
+# define SHADOW_OFFSET (1ULL << 44)
+# endif
+# endif
#endif // ASAN_FLEXIBLE_MAPPING_AND_OFFSET
#define SHADOW_GRANULARITY (1ULL << SHADOW_SCALE)
More information about the llvm-commits
mailing list