diff --git a/compiler-rt/lib/asan/asan_rtl_static.cpp b/compiler-rt/lib/asan/asan_rtl_static.cpp --- a/compiler-rt/lib/asan/asan_rtl_static.cpp +++ b/compiler-rt/lib/asan/asan_rtl_static.cpp @@ -13,3 +13,24 @@ // This file is empty for now. Main reason to have it is workaround for Windows // build, which complains because no files are part of the asan_static lib. + +#include "sanitizer_common/sanitizer_common.h" + +#define REPORT_FUNCTION(Name) \ + extern "C" SANITIZER_WEAK_ATTRIBUTE void Name(__asan::uptr addr); \ + extern "C" void Name##_asm(uptr addr) { Name(addr); } + +namespace __asan { + +REPORT_FUNCTION(__asan_report_load1) +REPORT_FUNCTION(__asan_report_load2) +REPORT_FUNCTION(__asan_report_load4) +REPORT_FUNCTION(__asan_report_load8) +REPORT_FUNCTION(__asan_report_load16) +REPORT_FUNCTION(__asan_report_store1) +REPORT_FUNCTION(__asan_report_store2) +REPORT_FUNCTION(__asan_report_store4) +REPORT_FUNCTION(__asan_report_store8) +REPORT_FUNCTION(__asan_report_store16) + +} // namespace __asan 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 @@ -42,7 +42,7 @@ pop %rcx ;\ jl RLABEL(reg, op, 1, i);\ mov %##reg,%rdi ;\ - jmp __asan_report_##op##1@PLT ;\ + jmp __asan_report_##op##1_asm ;\ #define ASAN_MEMORY_ACCESS_EXTRA_CHECK_2(reg, op, i) \ CLABEL(reg, op, 2, i): ;\ @@ -54,7 +54,7 @@ pop %rcx ;\ jl RLABEL(reg, op, 2, i);\ mov %##reg,%rdi ;\ - jmp __asan_report_##op##2@PLT ;\ + jmp __asan_report_##op##2_asm ;\ #define ASAN_MEMORY_ACCESS_EXTRA_CHECK_4(reg, op, i) \ CLABEL(reg, op, 4, i): ;\ @@ -66,7 +66,7 @@ pop %rcx ;\ jl RLABEL(reg, op, 4, i);\ mov %##reg,%rdi ;\ - jmp __asan_report_##op##4@PLT ;\ + jmp __asan_report_##op##4_asm ;\ #define ASAN_MEMORY_ACCESS_CALLBACK_ADD_1(reg, op) \ BEGINF(reg, op, 1, add) ;\ @@ -97,7 +97,7 @@ #define ASAN_MEMORY_ACCESS_FAIL(reg, op, s, i) \ FLABEL(reg, op, s, i): ;\ mov %##reg,%rdi ;\ - jmp __asan_report_##op##s@PLT;\ + jmp __asan_report_##op##s##_asm;\ #define ASAN_MEMORY_ACCESS_CALLBACK_ADD_8(reg, op) \ BEGINF(reg, op, 8, add) ;\