forked from OSchip/llvm-project
[ASan/Win] Make sure the list of wrappers exported by the main module and imported by the DLL thunk always matches
llvm-svn: 209444
This commit is contained in:
parent
b2a6fdb11a
commit
b2eb3131f4
|
@ -301,6 +301,8 @@ WRAP_W_W(_expand_dbg)
|
|||
|
||||
INTERCEPT_LIBRARY_FUNCTION(atoi);
|
||||
INTERCEPT_LIBRARY_FUNCTION(atol);
|
||||
INTERCEPT_LIBRARY_FUNCTION(frexp);
|
||||
INTERCEPT_LIBRARY_FUNCTION(longjmp);
|
||||
INTERCEPT_LIBRARY_FUNCTION(memchr);
|
||||
INTERCEPT_LIBRARY_FUNCTION(memcmp);
|
||||
INTERCEPT_LIBRARY_FUNCTION(memcpy);
|
||||
|
|
|
@ -293,6 +293,7 @@ INTERCEPTOR(void, __cxa_throw, void *a, void *b, void *c) {
|
|||
}
|
||||
#endif
|
||||
|
||||
#if ASAN_INTERCEPT_MLOCKX
|
||||
// intercept mlock and friends.
|
||||
// Since asan maps 16T of RAM, mlock is completely unfriendly to asan.
|
||||
// All functions return 0 (success).
|
||||
|
@ -324,6 +325,7 @@ INTERCEPTOR(int, munlockall, void) {
|
|||
MlockIsUnsupported();
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline int CharCmp(unsigned char c1, unsigned char c2) {
|
||||
return (c1 == c2) ? 0 : (c1 < c2) ? -1 : 1;
|
||||
|
|
|
@ -3,6 +3,17 @@
|
|||
// Just make sure we can compile this.
|
||||
// The actual compile&run sequence is to be done by the DLL tests.
|
||||
// RUN: %clangxx_asan -O0 %s -Fe%t
|
||||
//
|
||||
// Get the list of ASan wrappers exported by the main module RTL:
|
||||
// RUN: dumpbin /EXPORTS %t | grep -o "__asan_wrap[^ ]*" < %t.exports | grep -v @ | sort | uniq > %t.exported_wrappers
|
||||
//
|
||||
// Get the list of ASan wrappers imported by the DLL RTL:
|
||||
// RUN: grep INTERCEPT_LIBRARY_FUNCTION %p/../../../../lib/asan/asan_dll_thunk.cc | grep -v define | sed "s/.*(\(.*\)).*/__asan_wrap_\1/" | sort | uniq > %t.dll_imports
|
||||
//
|
||||
// Now make sure the DLL thunk imports everything:
|
||||
// RUN: echo
|
||||
// RUN: echo "=== NOTE === If you see a mismatch below, please update asan_dll_thunk.cc"
|
||||
// RUN: diff %t.dll_imports %t.exported_wrappers
|
||||
|
||||
#include <stdio.h>
|
||||
#include <windows.h>
|
||||
|
|
Loading…
Reference in New Issue