diff --git a/compiler-rt/lib/asan/asan_interface.inc b/compiler-rt/lib/asan/asan_interface.inc --- a/compiler-rt/lib/asan/asan_interface.inc +++ b/compiler-rt/lib/asan/asan_interface.inc @@ -180,3 +180,37 @@ INTERFACE_WEAK_FUNCTION(__asan_default_options) INTERFACE_WEAK_FUNCTION(__asan_default_suppressions) INTERFACE_WEAK_FUNCTION(__asan_on_error) + +#if defined(__x86_64__) + +# define ASAN_MEMORY_ACCESS_CALLBACK_ADD(s, reg, op) \ + INTERFACE_FUNCTION(__asan_check_##op##_add_##s##_##reg) + +# define ASAN_MEMORY_ACCESS_CALLBACKS_ADD(reg) \ + ASAN_MEMORY_ACCESS_CALLBACK_ADD(1, reg, load) \ + ASAN_MEMORY_ACCESS_CALLBACK_ADD(1, reg, store) \ + ASAN_MEMORY_ACCESS_CALLBACK_ADD(2, reg, load) \ + ASAN_MEMORY_ACCESS_CALLBACK_ADD(2, reg, store) \ + ASAN_MEMORY_ACCESS_CALLBACK_ADD(4, reg, load) \ + ASAN_MEMORY_ACCESS_CALLBACK_ADD(4, reg, store) \ + ASAN_MEMORY_ACCESS_CALLBACK_ADD(8, reg, load) \ + ASAN_MEMORY_ACCESS_CALLBACK_ADD(8, reg, store) \ + ASAN_MEMORY_ACCESS_CALLBACK_ADD(16, reg, load) \ + ASAN_MEMORY_ACCESS_CALLBACK_ADD(16, reg, store) + +ASAN_MEMORY_ACCESS_CALLBACKS_ADD(RAX) +ASAN_MEMORY_ACCESS_CALLBACKS_ADD(RBX) +ASAN_MEMORY_ACCESS_CALLBACKS_ADD(RCX) +ASAN_MEMORY_ACCESS_CALLBACKS_ADD(RDX) +ASAN_MEMORY_ACCESS_CALLBACKS_ADD(RSI) +ASAN_MEMORY_ACCESS_CALLBACKS_ADD(RDI) +ASAN_MEMORY_ACCESS_CALLBACKS_ADD(RBP) +ASAN_MEMORY_ACCESS_CALLBACKS_ADD(R8) +ASAN_MEMORY_ACCESS_CALLBACKS_ADD(R9) +ASAN_MEMORY_ACCESS_CALLBACKS_ADD(R12) +ASAN_MEMORY_ACCESS_CALLBACKS_ADD(R13) +ASAN_MEMORY_ACCESS_CALLBACKS_ADD(R14) +ASAN_MEMORY_ACCESS_CALLBACKS_ADD(R15) + +#endif // defined(__x86_64__) + diff --git a/compiler-rt/lib/asan/asan_rtl_x86_64.S b/compiler-rt/lib/asan/asan_rtl_x86_64.S --- a/compiler-rt/lib/asan/asan_rtl_x86_64.S +++ b/compiler-rt/lib/asan/asan_rtl_x86_64.S @@ -16,7 +16,6 @@ #define BEGINF(reg, op, s, i) \ .globl FNAME(reg, op, s, i) ;\ -.hidden FNAME(reg, op, s, i) ;\ ASM_TYPE_FUNCTION(FNAME(reg, op, s, i)) ;\ .cfi_startproc ;\ FNAME(reg, op, s, i): ;\