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

llvm-svn: 157388
diff --git a/compiler-rt/lib/interception/interception_linux.cc b/compiler-rt/lib/interception/interception_linux.cc
index 74fcf56..37e5933 100644
--- a/compiler-rt/lib/interception/interception_linux.cc
+++ b/compiler-rt/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