[llvm] 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:
llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
Modified: llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp?rev=243548&r1=243547&r2=243548&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp Wed Jul 29 13:22:25 2015
@@ -340,12 +340,12 @@ static ShadowMapping getShadowMapping(Tr
ShadowMapping Mapping;
- if (IsAndroid) {
+ if (LongSize == 32) {
// Android is always PIE, which means that the beginning of the address
// space is always available.
- Mapping.Offset = 0;
- } else if (LongSize == 32) {
- if (IsMIPS32)
+ if (IsAndroid)
+ Mapping.Offset = 0;
+ else if (IsMIPS32)
Mapping.Offset = kMIPS32_ShadowOffset32;
else if (IsFreeBSD)
Mapping.Offset = kFreeBSD_ShadowOffset32;
More information about the llvm-commits
mailing list