From bd310f02a5918826eae2a4bc83b7340a0b00f3c8 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 28 May 2012 07:47:35 +0000 Subject: [PATCH] asan/tsan: rename interceptors from __xsan_xxx to __interceptor_xxx llvm-svn: 157569 --- .../lib/asan/output_tests/interception_malloc_test-linux.cc | 4 ++-- compiler-rt/lib/asan/output_tests/interception_test-linux.cc | 4 ++-- compiler-rt/lib/interception/interception.h | 10 +++++----- compiler-rt/lib/tsan/rtl/tsan_rtl_report.cc | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/compiler-rt/lib/asan/output_tests/interception_malloc_test-linux.cc b/compiler-rt/lib/asan/output_tests/interception_malloc_test-linux.cc index e1a1960..4bb3bd6 100644 --- a/compiler-rt/lib/asan/output_tests/interception_malloc_test-linux.cc +++ b/compiler-rt/lib/asan/output_tests/interception_malloc_test-linux.cc @@ -2,10 +2,10 @@ #include #include -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() { diff --git a/compiler-rt/lib/asan/output_tests/interception_test-linux.cc b/compiler-rt/lib/asan/output_tests/interception_test-linux.cc index 84636f8..0523510 100644 --- a/compiler-rt/lib/asan/output_tests/interception_test-linux.cc +++ b/compiler-rt/lib/asan/output_tests/interception_test-linux.cc @@ -1,10 +1,10 @@ #include #include -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() { diff --git a/compiler-rt/lib/interception/interception.h b/compiler-rt/lib/interception/interception.h index 0a7eedc..d3e807a 100644 --- a/compiler-rt/lib/interception/interception.h +++ b/compiler-rt/lib/interception/interception.h @@ -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 @@ -93,12 +93,12 @@ # 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 diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cc b/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cc index 2986440..b3f8390 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cc @@ -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); -- 2.7.4