asan/tsan: rename interceptors from __xsan_xxx to __interceptor_xxx
authorDmitry Vyukov <dvyukov@google.com>
Mon, 28 May 2012 07:47:35 +0000 (07:47 +0000)
committerDmitry Vyukov <dvyukov@google.com>
Mon, 28 May 2012 07:47:35 +0000 (07:47 +0000)
llvm-svn: 157569

compiler-rt/lib/asan/output_tests/interception_malloc_test-linux.cc
compiler-rt/lib/asan/output_tests/interception_test-linux.cc
compiler-rt/lib/interception/interception.h
compiler-rt/lib/tsan/rtl/tsan_rtl_report.cc

index e1a1960..4bb3bd6 100644 (file)
@@ -2,10 +2,10 @@
 #include <stdio.h>
 #include <unistd.h>
 
-extern "C" void *__xsan_malloc(size_t size);
+extern "C" void *__interceptor_malloc(size_t size);
 extern "C" void *malloc(size_t size) {
   write(2, "malloc call\n", sizeof("malloc call\n") - 1);
-  return __xsan_malloc(size);
+  return __interceptor_malloc(size);
 }
 
 int main() {
index 84636f8..0523510 100644 (file)
@@ -1,10 +1,10 @@
 #include <stdlib.h>
 #include <stdio.h>
 
-extern "C" long __xsan_strtol(const char *nptr, char **endptr, int base);
+extern "C" long __interceptor_strtol(const char *nptr, char **endptr, int base);
 extern "C" long strtol(const char *nptr, char **endptr, int base) {
   fprintf(stderr, "my_strtol_interceptor\n");
-  return __xsan_strtol(nptr, endptr, base);
+  return __interceptor_strtol(nptr, endptr, base);
 }
 
 int main() {
index 0a7eedc..d3e807a 100644 (file)
@@ -65,8 +65,8 @@
 // with same names in our library and then obtain the real function pointers
 // using dlsym().
 // There is one complication. A user may also intercept some of the functions
-// we intercept. To resolve this we declare our interceptors with __xsan_
-// prefix, and then make actual interceptors weak aliases to __xsan_
+// we intercept. To resolve this we declare our interceptors with __interceptor_
+// prefix, and then make actual interceptors weak aliases to __interceptor_
 // functions.
 // This is not so on Mac OS, where the two-level namespace makes
 // our replacement functions invisible to other libraries. This may be overcomed
 # endif
 # define DECLARE_WRAPPER(ret_type, convention, func, ...)
 #else
-# define WRAP(x) __xsan_ ## x
-# define WRAPPER_NAME(x) "__xsan_" #x
+# define WRAP(x) __interceptor_ ## x
+# define WRAPPER_NAME(x) "__interceptor_" #x
 # define INTERCEPTOR_ATTRIBUTE __attribute__((visibility("default")))
 # define DECLARE_WRAPPER(ret_type, convention, func, ...) \
     extern "C" ret_type convention func(__VA_ARGS__) \
-    __attribute__((weak, alias("__xsan_" #func), visibility("default")))
+    __attribute__((weak, alias("__interceptor_" #func), visibility("default")))
 #endif
 
 #define PTR_TO_REAL(x) real_##x
index 2986440..b3f8390 100644 (file)
@@ -32,7 +32,7 @@ bool WEAK OnReport(const ReportDesc *rep, bool suppressed) {
 static void StackStripMain(ReportStack *stack) {
   ReportStack *last_frame = 0;
   ReportStack *last_frame2 = 0;
-  const char *prefix = "__xsan_";
+  const char *prefix = "__interceptor_";
   uptr prefix_len = internal_strlen(prefix);
   const char *path_prefix = flags()->strip_path_prefix;
   uptr path_prefix_len = internal_strlen(path_prefix);