summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2013-12-19 11:08:47 +0000
committerAlexey Samsonov <samsonov@google.com>2013-12-19 11:08:47 +0000
commit8b6cd2f1f655d46a999ba3498177de1207dde430 (patch)
treee9796c0c05c9efb3b3eb2ec2fd327fd170c8133d
parent0e0d9f159ac1bf2bfcae8a9ae337fc9ca4da91de (diff)
[ASan] Get rid of __asan_symbolize function
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@197670 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/sanitizer/asan_interface.h8
-rw-r--r--lib/asan/asan_interface_internal.h4
-rw-r--r--lib/asan/asan_stack.cc18
-rw-r--r--lib/asan/lit_tests/TestCases/Darwin/interface_symbols_darwin.c1
-rw-r--r--lib/asan/lit_tests/TestCases/Linux/interface_symbols_linux.c1
-rw-r--r--lib/asan/lit_tests/TestCases/symbolize_callback.cc17
6 files changed, 1 insertions, 48 deletions
diff --git a/include/sanitizer/asan_interface.h b/include/sanitizer/asan_interface.h
index 8adf3f17f..a943cfe34 100644
--- a/include/sanitizer/asan_interface.h
+++ b/include/sanitizer/asan_interface.h
@@ -82,14 +82,6 @@ extern "C" {
// the program crashes before ASan report is printed.
void __asan_on_error();
- // User may provide its own implementation for symbolization function.
- // It should print the description of instruction at address "pc" to
- // "out_buffer". Description should be at most "out_size" bytes long.
- // User-specified function should return true if symbolization was
- // successful.
- bool __asan_symbolize(const void *pc, char *out_buffer,
- int out_size);
-
// Returns the estimated number of bytes that will be reserved by allocator
// for request of "size" bytes. If ASan allocator can't allocate that much
// memory, returns the maximal possible allocation size, otherwise returns
diff --git a/lib/asan/asan_interface_internal.h b/lib/asan/asan_interface_internal.h
index 5c1d02529..15d4b60ef 100644
--- a/lib/asan/asan_interface_internal.h
+++ b/lib/asan/asan_interface_internal.h
@@ -99,10 +99,6 @@ extern "C" {
SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
/* OPTIONAL */ void __asan_on_error();
- SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
- /* OPTIONAL */ bool __asan_symbolize(const void *pc, char *out_buffer,
- int out_size);
-
SANITIZER_INTERFACE_ATTRIBUTE
uptr __asan_get_estimated_allocated_size(uptr size);
diff --git a/lib/asan/asan_stack.cc b/lib/asan/asan_stack.cc
index 8934913f3..31a59511f 100644
--- a/lib/asan/asan_stack.cc
+++ b/lib/asan/asan_stack.cc
@@ -18,14 +18,8 @@
namespace __asan {
-static bool MaybeCallAsanSymbolize(const void *pc, char *out_buffer,
- int out_size) {
- return (&__asan_symbolize) ? __asan_symbolize(pc, out_buffer, out_size)
- : false;
-}
-
void PrintStack(const uptr *trace, uptr size) {
- StackTrace::PrintStack(trace, size, MaybeCallAsanSymbolize);
+ StackTrace::PrintStack(trace, size);
}
void PrintStack(StackTrace *stack) {
@@ -36,16 +30,6 @@ void PrintStack(StackTrace *stack) {
// ------------------ Interface -------------- {{{1
-// Provide default implementation of __asan_symbolize that does nothing
-// and may be overriden by user if he wants to use his own symbolization.
-// ASan on Windows has its own implementation of this.
-#if !SANITIZER_SUPPORTS_WEAK_HOOKS
-SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE NOINLINE
-bool __asan_symbolize(const void *pc, char *out_buffer, int out_size) {
- return false;
-}
-#endif
-
extern "C" {
SANITIZER_INTERFACE_ATTRIBUTE
void __sanitizer_print_stack_trace() {
diff --git a/lib/asan/lit_tests/TestCases/Darwin/interface_symbols_darwin.c b/lib/asan/lit_tests/TestCases/Darwin/interface_symbols_darwin.c
index b453b64ca..c13cb3cf1 100644
--- a/lib/asan/lit_tests/TestCases/Darwin/interface_symbols_darwin.c
+++ b/lib/asan/lit_tests/TestCases/Darwin/interface_symbols_darwin.c
@@ -12,7 +12,6 @@
// RUN: | grep "__asan_" | sed "s/___asan_/__asan_/" \
// RUN: | grep -v "__asan_malloc_hook" \
// RUN: | grep -v "__asan_free_hook" \
-// RUN: | grep -v "__asan_symbolize" \
// RUN: | grep -v "__asan_default_options" \
// RUN: | grep -v "__asan_on_error" > %t.symbols
diff --git a/lib/asan/lit_tests/TestCases/Linux/interface_symbols_linux.c b/lib/asan/lit_tests/TestCases/Linux/interface_symbols_linux.c
index d6ceda7af..26e5083ff 100644
--- a/lib/asan/lit_tests/TestCases/Linux/interface_symbols_linux.c
+++ b/lib/asan/lit_tests/TestCases/Linux/interface_symbols_linux.c
@@ -5,7 +5,6 @@
// RUN: | grep "__asan_" | sed "s/___asan_/__asan_/" \
// RUN: | grep -v "__asan_malloc_hook" \
// RUN: | grep -v "__asan_free_hook" \
-// RUN: | grep -v "__asan_symbolize" \
// RUN: | grep -v "__asan_default_options" \
// RUN: | grep -v "__asan_stack_" \
// RUN: | grep -v "__asan_on_error" > %t.symbols
diff --git a/lib/asan/lit_tests/TestCases/symbolize_callback.cc b/lib/asan/lit_tests/TestCases/symbolize_callback.cc
deleted file mode 100644
index 058b3150f..000000000
--- a/lib/asan/lit_tests/TestCases/symbolize_callback.cc
+++ /dev/null
@@ -1,17 +0,0 @@
-// RUN: %clangxx_asan -O2 %s -o %t && not %t 2>&1 | FileCheck %s
-
-#include <stdio.h>
-#include <stdlib.h>
-
-extern "C"
-bool __asan_symbolize(const void *pc, char *out_buffer, int out_size) {
- snprintf(out_buffer, out_size, "MySymbolizer");
- return true;
-}
-
-int main() {
- char *x = (char*)malloc(10 * sizeof(char));
- free(x);
- return x[5];
- // CHECK: MySymbolizer
-}