[compiler-rt] r207002 - [ASan] Move the shadow range on 32-bit iOS (and iOS Simulator)
Alexander Potapenko
glider at google.com
Wed Apr 23 10:14:45 PDT 2014
Author: glider
Date: Wed Apr 23 12:14:45 2014
New Revision: 207002
URL: http://llvm.org/viewvc/llvm-project?rev=207002&view=rev
Log:
[ASan] Move the shadow range on 32-bit iOS (and iOS Simulator)
to 0x40000000-0x60000000 to avoid address space clash with system libraries.
The solution has been proposed by tahabekireren at gmail.com in https://code.google.com/p/address-sanitizer/issues/detail?id=210
This is also known to fix some Chromium iOS tests.
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=207002&r1=207001&r2=207002&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_mapping.h (original)
+++ compiler-rt/trunk/lib/asan/asan_mapping.h Wed Apr 23 12:14:45 2014
@@ -67,7 +67,8 @@
// || `[0x00000000, 0x0aaa7fff]` || LowMem ||
static const u64 kDefaultShadowScale = 3;
-static const u64 kDefaultShadowOffset32 = 1ULL << 29;
+static const u64 kDefaultShadowOffset32 = 1ULL << 29; // 0x20000000
+static const u64 kIosShadowOffset32 = 1ULL << 30; // 0x40000000
static const u64 kDefaultShadowOffset64 = 1ULL << 44;
static const u64 kDefaultShort64bitShadowOffset = 0x7FFF8000; // < 2G.
static const u64 kAArch64_ShadowOffset64 = 1ULL << 36;
@@ -81,7 +82,11 @@ static const u64 kMIPS32_ShadowOffset32
# if defined(__mips__)
# define SHADOW_OFFSET kMIPS32_ShadowOffset32
# else
-# define SHADOW_OFFSET kDefaultShadowOffset32
+# if SANITIZER_IOS
+# define SHADOW_OFFSET kIosShadowOffset32
+# else
+# define SHADOW_OFFSET kDefaultShadowOffset32
+# endif
# endif
# else
# if defined(__aarch64__)
More information about the llvm-commits
mailing list