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
diff --git a/lib/interception/interception_linux.h b/lib/interception/interception_linux.h
index 102b3c1..76a29c6 100644
--- a/lib/interception/interception_linux.h
+++ b/lib/interception/interception_linux.h
@@ -23,11 +23,13 @@
namespace __interception {
// returns true if a function with the given name was found.
-bool GetRealFunctionAddress(const char *func_name, void **func_addr);
+bool GetRealFunctionAddress(const char *func_name, void **func_addr,
+ void *real, void *wrapper);
} // namespace __interception
#define INTERCEPT_FUNCTION_LINUX(func) \
- ::__interception::GetRealFunctionAddress(#func, (void**)&REAL(func))
+ ::__interception::GetRealFunctionAddress(#func, (void**)&REAL(func), \
+ (void*)&(func), (void*)&WRAP(func))
#endif // INTERCEPTION_LINUX_H
#endif // __linux__