diff options
| author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2018-08-13 21:07:27 +0000 |
|---|---|---|
| committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2018-08-13 21:07:27 +0000 |
| commit | d8cc7f9f079f03829157ba6dcd22afdfcbc60627 (patch) | |
| tree | 3ace17d7685fc7d6910d754787d0da637ddc4b6b /compiler-rt/include | |
| parent | 4a6f190e19d4b4f47e714b783c3ce2ce562eed5d (diff) | |
| download | bcm5719-llvm-d8cc7f9f079f03829157ba6dcd22afdfcbc60627.tar.gz bcm5719-llvm-d8cc7f9f079f03829157ba6dcd22afdfcbc60627.zip | |
[hwasan] Provide __sanitizer_* aliases to allocator functions.
Summary:
Export __sanitizer_malloc, etc as aliases to malloc, etc.
This way users can wrap sanitizer malloc, even in fully static binaries.
Both jemalloc and tcmalloc provide similar aliases (je_* and tc_*).
Reviewers: vitalybuka, kcc
Subscribers: llvm-commits, kubamracek
Differential Revision: https://reviews.llvm.org/D50570
llvm-svn: 339614
Diffstat (limited to 'compiler-rt/include')
| -rw-r--r-- | compiler-rt/include/sanitizer/allocator_interface.h | 1 | ||||
| -rw-r--r-- | compiler-rt/include/sanitizer/hwasan_interface.h | 15 |
2 files changed, 15 insertions, 1 deletions
diff --git a/compiler-rt/include/sanitizer/allocator_interface.h b/compiler-rt/include/sanitizer/allocator_interface.h index 89f328301db..e44c4a13ed6 100644 --- a/compiler-rt/include/sanitizer/allocator_interface.h +++ b/compiler-rt/include/sanitizer/allocator_interface.h @@ -82,7 +82,6 @@ extern "C" { Currently available with ASan only. */ void __sanitizer_purge_allocator(void); - #ifdef __cplusplus } // extern "C" #endif diff --git a/compiler-rt/include/sanitizer/hwasan_interface.h b/compiler-rt/include/sanitizer/hwasan_interface.h index 7f0d36f718b..75d31a6c35f 100644 --- a/compiler-rt/include/sanitizer/hwasan_interface.h +++ b/compiler-rt/include/sanitizer/hwasan_interface.h @@ -32,6 +32,21 @@ extern "C" { void __hwasan_enable_allocator_tagging(void); void __hwasan_disable_allocator_tagging(void); + int __sanitizer_posix_memalign(void **memptr, size_t alignment, size_t size); + void * __sanitizer_memalign(size_t alignment, size_t size); + void * __sanitizer_aligned_alloc(size_t alignment, size_t size); + void * __sanitizer___libc_memalign(size_t alignment, size_t size); + void * __sanitizer_valloc(size_t size); + void * __sanitizer_pvalloc(size_t size); + void __sanitizer_free(void *ptr); + void __sanitizer_cfree(void *ptr); + size_t __sanitizer_malloc_usable_size(const void *ptr); + struct mallinfo __sanitizer_mallinfo(); + int __sanitizer_mallopt(int cmd, int value); + void __sanitizer_malloc_stats(void); + void * __sanitizer_calloc(size_t nmemb, size_t size); + void * __sanitizer_realloc(void *ptr, size_t size); + void * __sanitizer_malloc(size_t size); #ifdef __cplusplus } // extern "C" #endif |

