diff options
author | Alexander Potapenko <glider@google.com> | 2012-08-15 11:57:52 +0000 |
---|---|---|
committer | Alexander Potapenko <glider@google.com> | 2012-08-15 11:57:52 +0000 |
commit | ec3b0732a62bd0a52da7bbfc4e227038ccf9372c (patch) | |
tree | 6037efb304ed612e275cf2be610a16ff2f59d2a4 /lib | |
parent | 11f2b17a5cae796c047a7e22bea4452da337bbce (diff) | |
download | compiler-rt-ec3b0732a62bd0a52da7bbfc4e227038ccf9372c.tar.gz |
Use SANITIZER_INTERFACE_ATTRIBUTE instead of __attribute__((visibility("default")))
Export CheckFailed, asan_malloc, asan_free, asan_memalign, AsanStackTrace::CompressStack, AsanStackTrace::UncompressStack from the dynamic runtime library.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@161943 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/asan/asan_allocator.cc | 6 | ||||
-rw-r--r-- | lib/asan/asan_rtl.cc | 1 | ||||
-rw-r--r-- | lib/asan/asan_stack.cc | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/lib/asan/asan_allocator.cc b/lib/asan/asan_allocator.cc index 3b0a78377..7d00de125 100644 --- a/lib/asan/asan_allocator.cc +++ b/lib/asan/asan_allocator.cc @@ -810,20 +810,20 @@ static inline void ASAN_DELETE_HOOK(void *ptr) { } namespace __asan { -__attribute__((visibility("default"))) +SANITIZER_INTERFACE_ATTRIBUTE void *asan_memalign(uptr alignment, uptr size, AsanStackTrace *stack) { void *ptr = (void*)Allocate(alignment, size, stack); ASAN_NEW_HOOK(ptr, size); return ptr; } -__attribute__((visibility("default"))) +SANITIZER_INTERFACE_ATTRIBUTE void asan_free(void *ptr, AsanStackTrace *stack) { ASAN_DELETE_HOOK(ptr); Deallocate((u8*)ptr, stack); } -__attribute__((visibility("default"))) +SANITIZER_INTERFACE_ATTRIBUTE void *asan_malloc(uptr size, AsanStackTrace *stack) { void *ptr = (void*)Allocate(0, size, stack); ASAN_NEW_HOOK(ptr, size); diff --git a/lib/asan/asan_rtl.cc b/lib/asan/asan_rtl.cc index f1b4e629b..0f87253a4 100644 --- a/lib/asan/asan_rtl.cc +++ b/lib/asan/asan_rtl.cc @@ -48,6 +48,7 @@ void Die() { Exit(flags()->exitcode); } +SANITIZER_INTERFACE_ATTRIBUTE void CheckFailed(const char *file, int line, const char *cond, u64 v1, u64 v2) { AsanReport("AddressSanitizer CHECK failed: %s:%d \"%s\" (0x%zx, 0x%zx)\n", file, line, cond, (uptr)v1, (uptr)v2); diff --git a/lib/asan/asan_stack.cc b/lib/asan/asan_stack.cc index 703cc692b..8b432e48c 100644 --- a/lib/asan/asan_stack.cc +++ b/lib/asan/asan_stack.cc @@ -138,6 +138,7 @@ void AsanStackTrace::FastUnwindStack(uptr pc, uptr bp) { // On 32-bits we don't compress stack traces. // On 64-bits we compress stack traces: if a given pc differes slightly from // the previous one, we record a 31-bit offset instead of the full pc. +SANITIZER_INTERFACE_ATTRIBUTE uptr AsanStackTrace::CompressStack(AsanStackTrace *stack, u32 *compressed, uptr size) { #if __WORDSIZE == 32 @@ -201,6 +202,7 @@ uptr AsanStackTrace::CompressStack(AsanStackTrace *stack, return res; } +SANITIZER_INTERFACE_ATTRIBUTE void AsanStackTrace::UncompressStack(AsanStackTrace *stack, u32 *compressed, uptr size) { #if __WORDSIZE == 32 |