[PATCH] [ASan] Support the asan_loadN/asan_storeN functions in the DLL thunk library

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


Closed by commit rL214532 (authored by @ehsan).

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D4758

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

Index: compiler-rt/trunk/test/asan/TestCases/Windows/dll_large_function.cc
===================================================================
--- compiler-rt/trunk/test/asan/TestCases/Windows/dll_large_function.cc
+++ compiler-rt/trunk/test/asan/TestCases/Windows/dll_large_function.cc
@@ -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;
+}
Index: compiler-rt/trunk/lib/asan/asan_dll_thunk.cc
===================================================================
--- compiler-rt/trunk/lib/asan/asan_dll_thunk.cc
+++ compiler-rt/trunk/lib/asan/asan_dll_thunk.cc
@@ -235,6 +235,20 @@
 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);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4758.12113.patch
Type: text/x-patch
Size: 1642 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140801/39382612/attachment.bin>


More information about the llvm-commits mailing list