[libFuzzer] add 'weak' back to __sanitizer_malloc_hook and __sanitizer_free_hook

llvm-svn: 272116
This commit is contained in:
Kostya Serebryany 2016-06-08 04:49:29 +00:00
parent 250024f905
commit 53b7b3ca5f
1 changed files with 2 additions and 0 deletions

View File

@ -464,10 +464,12 @@ static thread_local MallocFreeTracer AllocTracer;
// thread local storage is initialised leading to // thread local storage is initialised leading to
// crashes when accessing ``AllocTracer``. // crashes when accessing ``AllocTracer``.
extern "C" { extern "C" {
__attribute__((weak))
void __sanitizer_malloc_hook(void *ptr, size_t size) { void __sanitizer_malloc_hook(void *ptr, size_t size) {
if (!LIBFUZZER_APPLE) if (!LIBFUZZER_APPLE)
AllocTracer.Mallocs++; AllocTracer.Mallocs++;
} }
__attribute__((weak))
void __sanitizer_free_hook(void *ptr) { void __sanitizer_free_hook(void *ptr) {
if (!LIBFUZZER_APPLE) if (!LIBFUZZER_APPLE)
AllocTracer.Frees++; AllocTracer.Frees++;