[PATCH] D28598: [compiler-rt] [Sanitizer Coverage] Provide access to the default implementation of weak functions from sanitizer coverage for MD on Windows.

Marcos Pividori via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 17 16:08:45 PST 2017


mpividori updated this revision to Diff 84765.
mpividori added a comment.

@rnk I updated the code according to changes in revision: https://reviews.llvm.org/D28596
Let me know if you agree now.


https://reviews.llvm.org/D28598

Files:
  lib/asan/asan_win_dynamic_runtime_thunk.cc


Index: lib/asan/asan_win_dynamic_runtime_thunk.cc
===================================================================
--- lib/asan/asan_win_dynamic_runtime_thunk.cc
+++ lib/asan/asan_win_dynamic_runtime_thunk.cc
@@ -25,9 +25,27 @@
 // simplifies the build procedure.
 #ifdef ASAN_DYNAMIC_RUNTIME_THUNK
 #include "sanitizer_common/sanitizer_win_defs.h"
+#include "sanitizer_common/sanitizer_interface_internal.h"
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 
+// Define weak alias for all weak functions from sanitizer coverage.
+// For each function "fun", WEAK_DEF_NAME(fun) is the default implementation
+// exported by the dll.
+#define WEAK_IMPORT(Name) WIN_WEAK_ALIAS(Name, WEAK_DEF_NAME(Name))
+WEAK_IMPORT(__sanitizer_cov_trace_cmp)
+WEAK_IMPORT(__sanitizer_cov_trace_cmp1)
+WEAK_IMPORT(__sanitizer_cov_trace_cmp2)
+WEAK_IMPORT(__sanitizer_cov_trace_cmp4)
+WEAK_IMPORT(__sanitizer_cov_trace_cmp8)
+WEAK_IMPORT(__sanitizer_cov_trace_switch)
+WEAK_IMPORT(__sanitizer_cov_trace_div4)
+WEAK_IMPORT(__sanitizer_cov_trace_div8)
+WEAK_IMPORT(__sanitizer_cov_trace_gep)
+WEAK_IMPORT(__sanitizer_cov_trace_pc_indir)
+WEAK_IMPORT(__sanitizer_cov_trace_pc_guard)
+WEAK_IMPORT(__sanitizer_cov_trace_pc_guard_init)
+
 // First, declare CRT sections we'll be using in this file
 #pragma section(".CRT$XIB", long, read)  // NOLINT
 #pragma section(".CRT$XID", long, read)  // NOLINT


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28598.84765.patch
Type: text/x-patch
Size: 1382 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170118/90480ed5/attachment.bin>


More information about the llvm-commits mailing list