summaryrefslogtreecommitdiff
path: root/lib/asan/asan_internal.h
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2012-12-07 22:01:28 +0000
committerAlexey Samsonov <samsonov@google.com>2012-12-07 22:01:28 +0000
commit6a08d29b2020004b801ca69d8aea5872a7e67d72 (patch)
tree2b85ccc593a47d48fec8cef1b2e944044d63fb8d /lib/asan/asan_internal.h
parent063e4a54b2b4ccad8b9c40aa869a134c46804068 (diff)
downloadcompiler-rt-6a08d29b2020004b801ca69d8aea5872a7e67d72.tar.gz
compiler-rt-6a08d29b2020004b801ca69d8aea5872a7e67d72.tar.bz2
compiler-rt-6a08d29b2020004b801ca69d8aea5872a7e67d72.tar.xz
ASan: change the strategy we use for installing malloc/free/symbolization hooks on Linux: don't provide a default no-op implementations for hooks in runtime, and optionally call hooks if they are provided by the user. Don't force weak interface functions into runtime.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@169641 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_internal.h')
-rw-r--r--lib/asan/asan_internal.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/asan/asan_internal.h b/lib/asan/asan_internal.h
index 1a50e603..468d997c 100644
--- a/lib/asan/asan_internal.h
+++ b/lib/asan/asan_internal.h
@@ -145,6 +145,15 @@ bool PlatformHasDifferentMemcpyAndMemmove();
# define PLATFORM_HAS_DIFFERENT_MEMCPY_AND_MEMMOVE true
#endif // __APPLE__
+// Add convenient macro for interface functions that may be represented as
+// weak hooks.
+#define ASAN_MALLOC_HOOK(ptr, size) \
+ if (&__asan_malloc_hook) __asan_malloc_hook(ptr, size)
+#define ASAN_FREE_HOOK(ptr) \
+ if (&__asan_free_hook) __asan_free_hook(ptr)
+#define ASAN_ON_ERROR() \
+ if (&__asan_on_error) __asan_on_error()
+
extern int asan_inited;
// Used to avoid infinite recursion in __asan_init().
extern bool asan_init_is_running;