[compiler-rt] r214532 - [ASan] Support the asan_loadN/asan_storeN functions in the DLL thunk library

Ehsan Akhgari ehsan.akhgari at gmail.com
Fri Aug 1 11:04:53 PDT 2014


Author: ehsan
Date: Fri Aug  1 13:04:53 2014
New Revision: 214532

URL: http://llvm.org/viewvc/llvm-project?rev=214532&view=rev
Log:
[ASan] Support the asan_loadN/asan_storeN functions in the DLL thunk library

Summary:
This is required for linking DLLs with large functions exceeding
san-instrumentation-with-call-threshold.  One such function is
vp9_fdct16x16_sse2 in libvpx.

Reviewers: timurrrr

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D4758

Added:
    compiler-rt/trunk/test/asan/TestCases/Windows/dll_large_function.cc
Modified:
    compiler-rt/trunk/lib/asan/asan_dll_thunk.cc

Modified: compiler-rt/trunk/lib/asan/asan_dll_thunk.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_dll_thunk.cc?rev=214532&r1=214531&r2=214532&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_dll_thunk.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_dll_thunk.cc Fri Aug  1 13:04:53 2014
@@ -235,6 +235,20 @@ INTERFACE_FUNCTION(__asan_report_load8)
 INTERFACE_FUNCTION(__asan_report_load16)
 INTERFACE_FUNCTION(__asan_report_load_n)
 
+INTERFACE_FUNCTION(__asan_store1)
+INTERFACE_FUNCTION(__asan_store2)
+INTERFACE_FUNCTION(__asan_store4)
+INTERFACE_FUNCTION(__asan_store8)
+INTERFACE_FUNCTION(__asan_store16)
+INTERFACE_FUNCTION(__asan_storeN)
+
+INTERFACE_FUNCTION(__asan_load1)
+INTERFACE_FUNCTION(__asan_load2)
+INTERFACE_FUNCTION(__asan_load4)
+INTERFACE_FUNCTION(__asan_load8)
+INTERFACE_FUNCTION(__asan_load16)
+INTERFACE_FUNCTION(__asan_loadN)
+
 INTERFACE_FUNCTION(__asan_memcpy);
 INTERFACE_FUNCTION(__asan_memset);
 INTERFACE_FUNCTION(__asan_memmove);

Added: compiler-rt/trunk/test/asan/TestCases/Windows/dll_large_function.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Windows/dll_large_function.cc?rev=214532&view=auto
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Windows/dll_large_function.cc (added)
+++ compiler-rt/trunk/test/asan/TestCases/Windows/dll_large_function.cc Fri Aug  1 13:04:53 2014
@@ -0,0 +1,11 @@
+// Make sure we can link a DLL with large functions which would mean
+// functions such as __asan_loadN and __asan_storeN will be called
+// from the DLL.  We simulate the large function with
+// -mllvm -asan-instrumentation-with-call-threshold=0.
+// RUN: %clang_cl_asan %s -c -Fo%t.obj -mllvm -asan-instrumentation-with-call-threshold=0
+// RUN: link /nologo /DLL /OUT:%t.dll %t.obj %asan_dll_thunk
+
+void f(long* foo, long* bar) {
+  // One load and one store
+  *foo = *bar;
+}





More information about the llvm-commits mailing list