summaryrefslogtreecommitdiff
path: root/lib/interception/interception_linux.cc
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2012-05-24 13:54:31 +0000
committerDmitry Vyukov <dvyukov@google.com>2012-05-24 13:54:31 +0000
commit580469d7e40e39319cb2d3750edac4bccca18105 (patch)
treefca0e8f57a0c68e1aedf80f7f10c6cadf4f54117 /lib/interception/interception_linux.cc
parent24567d409cca096b950574fa4b19aa4c2c67a1f0 (diff)
downloadcompiler-rt-580469d7e40e39319cb2d3750edac4bccca18105.tar.gz
compiler-rt-580469d7e40e39319cb2d3750edac4bccca18105.tar.bz2
compiler-rt-580469d7e40e39319cb2d3750edac4bccca18105.tar.xz
asan/tsan: weak interceptors
The idea isthat asan/tsan can survive if user intercepts the same functions. At the same time user has an ability to call back into asan/tsan runtime. See the following tests for examples: asan/output_tests/interception_failure_test-linux.cc asan/output_tests/interception_test-linux.cc asan/output_tests/interception_malloc_test-linux.cc git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@157388 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/interception/interception_linux.cc')
-rw-r--r--lib/interception/interception_linux.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/interception/interception_linux.cc b/lib/interception/interception_linux.cc
index 74fcf563..37e59332 100644
--- a/lib/interception/interception_linux.cc
+++ b/lib/interception/interception_linux.cc
@@ -18,9 +18,10 @@
#include <dlfcn.h> // for dlsym
namespace __interception {
-bool GetRealFunctionAddress(const char *func_name, void **func_addr) {
+bool GetRealFunctionAddress(const char *func_name, void **func_addr,
+ void *real, void *wrapper) {
*func_addr = dlsym(RTLD_NEXT, func_name);
- return (*func_addr != NULL);
+ return real == wrapper;
}
} // namespace __interception