llvm-project/compiler-rt/lib
Marcos Pividori bfdfaa11ca [sanitizer] Split dll_thunks into different sanitizers.
When the sanitizer is implemented as a static library and is included in the
main executable, we need an auxiliary static library dll_thunk that will be
linked to the dlls that have instrumentation, so they can refer to the runtime
in the main executable. Basically, it uses interception to get a pointer the
function in the main executable and override its function with that pointer.

Before this diff, all of the implementation for dll_thunks was included in asan.
In this diff I split it into different sanitizers, so we can use other
sanitizers regardless of whether we include asan or not.

All the sanitizers include a file sanitizer_win_dll_thunk.cc that register
functions to be intercepted in the binary section: DLLTH

When the dll including dll_thunk is initialized, it will execute
__dll_thunk_init() implemented in: sanitizer_common/sanitizer_win_dll_thunk.cc,
which will consider all the CB registered in the section DLLTH. So, all the
functions registered will be intercepted, and redirected to the implementation
in the main executable.

All the files "sanitizer_win_dll_thunk.cc" are independent, so we don't need to
include a specific list of sanitizers. Now, we compile:  asan_win_dll_thunk.cc
ubsan_win_dll_thunk.cc,  sanitizer_coverage_win_dll_thunk.cc and
sanitizer_win_dll_thunk.cc, to generate asan_dll_thunk, because we include asan,
ubsan and sanitizer coverage in the address sanitizer library.

Differential Revision: https://reviews.llvm.org/D29154

llvm-svn: 293951
2017-02-02 23:01:28 +00:00
..
BlocksRuntime Move tests for BlocksRuntime and builtins to corresponding directories under test/ 2014-02-14 09:47:31 +00:00
asan [sanitizer] Split dll_thunks into different sanitizers. 2017-02-02 23:01:28 +00:00
builtins [Bultin][ARM] Make aeabi_uldivmod and aeabi_ldivmod be Thumb1 compatible 2017-01-30 18:48:05 +00:00
cfi Revert "[sancov] moving sancov rt to sancov/ directory" 2017-01-12 01:37:35 +00:00
dfsan Revert "[sancov] moving sancov rt to sancov/ directory" 2017-01-12 01:37:35 +00:00
esan Revert "[sancov] moving sancov rt to sancov/ directory" 2017-01-12 01:37:35 +00:00
interception [interception] Check for export table's size before referring to its elements. 2017-01-30 18:23:37 +00:00
lsan [tsan] Properly describe GCD worker threads in reports 2017-02-02 12:54:21 +00:00
msan Revert "[sancov] moving sancov rt to sancov/ directory" 2017-01-12 01:37:35 +00:00
profile [Profile] Fix value profiler eviction bug 2016-11-29 22:00:54 +00:00
safestack [compiler-rt] Do not introduce __sanitizer namespace globally 2016-09-15 21:02:18 +00:00
sanitizer_common [sanitizer] Split dll_thunks into different sanitizers. 2017-02-02 23:01:28 +00:00
scudo [scudo] Replacing std::atomic with Sanitizer's atomics 2017-01-20 18:32:18 +00:00
stats Revert "[sancov] moving sancov rt to sancov/ directory" 2017-01-12 01:37:35 +00:00
tsan [tsan] Provide API for libraries for race detection on custom objects 2017-02-02 13:17:05 +00:00
ubsan [sanitizer] Split dll_thunks into different sanitizers. 2017-02-02 23:01:28 +00:00
xray [XRay] Probe for CPU features that XRay needs 2017-02-02 07:51:21 +00:00
CMakeLists.txt Revert "[sancov] moving sancov rt to sancov/ directory" 2017-01-12 01:37:35 +00:00