summaryrefslogtreecommitdiff
path: root/lib/asan/asan_internal.h
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2013-02-15 12:00:24 +0000
committerKostya Serebryany <kcc@google.com>2013-02-15 12:00:24 +0000
commite31eca900a1f8849af75100c2d92e838d79d0920 (patch)
tree02039a2303dcbdd24f993dee28fbd2ef6b36299f /lib/asan/asan_internal.h
parenteab061185ec0046d447b298a1dff84f028202a3c (diff)
downloadcompiler-rt-e31eca900a1f8849af75100c2d92e838d79d0920.tar.gz
compiler-rt-e31eca900a1f8849af75100c2d92e838d79d0920.tar.bz2
compiler-rt-e31eca900a1f8849af75100c2d92e838d79d0920.tar.xz
[asan] make asan work with 7fff8000 offset and prelink
When prelink is installed in the system, prelink-ed libraries map between 0x003000000000 and 0x004000000000 thus occupying the shadow Gap, so we need so split the address space even further, like this: || [0x10007fff8000, 0x7fffffffffff] || HighMem || || [0x02008fff7000, 0x10007fff7fff] || HighShadow || || [0x004000000000, 0x02008fff6fff] || ShadowGap3 || || [0x003000000000, 0x003fffffffff] || MidMem || || [0x00087fff8000, 0x002fffffffff] || ShadowGap2 || || [0x00067fff8000, 0x00087fff7fff] || MidShadow || || [0x00008fff7000, 0x00067fff7fff] || ShadowGap || || [0x00007fff8000, 0x00008fff6fff] || LowShadow || || [0x000000000000, 0x00007fff7fff] || LowMem || Do it only if necessary. Also added a bit of profiling code to make sure that the mapping code is efficient. Added a lit test to simulate prelink-ed libraries. Unfortunately, this test does not work with binutils-gold linker. If gold is the default linker the test silently passes. Also replaced __has_feature(address_sanitizer) with __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__) in two places. Patch partially by Jakub Jelinek. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@175263 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_internal.h')
-rw-r--r--lib/asan/asan_internal.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/asan/asan_internal.h b/lib/asan/asan_internal.h
index dfab3f06..b3b1fe70 100644
--- a/lib/asan/asan_internal.h
+++ b/lib/asan/asan_internal.h
@@ -54,7 +54,7 @@
#define ASAN_POSIX (ASAN_LINUX || ASAN_MAC)
-#if __has_feature(address_sanitizer)
+#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
# error "The AddressSanitizer run-time should not be"
" instrumented by AddressSanitizer"
#endif