Make __asan::asan_{malloc,free,memalign} globally visible, so that the dynamic version of the runtime will export them.

llvm-svn: 161942
This commit is contained in:
Alexander Potapenko 2012-08-15 11:32:15 +00:00
parent 9fe914b099
commit 55df945db2
1 changed files with 3 additions and 0 deletions

View File

@ -810,17 +810,20 @@ static inline void ASAN_DELETE_HOOK(void *ptr) { }
namespace __asan {
__attribute__((visibility("default")))
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")))
void asan_free(void *ptr, AsanStackTrace *stack) {
ASAN_DELETE_HOOK(ptr);
Deallocate((u8*)ptr, stack);
}
__attribute__((visibility("default")))
void *asan_malloc(uptr size, AsanStackTrace *stack) {
void *ptr = (void*)Allocate(0, size, stack);
ASAN_NEW_HOOK(ptr, size);