summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_mac.cc
diff options
context:
space:
mode:
authorMarcos Pividori <mpividori@google.com>2017-02-02 23:02:15 +0000
committerMarcos Pividori <mpividori@google.com>2017-02-02 23:02:15 +0000
commit23e6a85eed9eee8638c0f0a51f174ebbc435931e (patch)
treedcada2bfb8daadcc21bebe5ca0842f029499f523 /lib/sanitizer_common/sanitizer_mac.cc
parent753739845908eef985f4b0b5c2c15a46646a8018 (diff)
[sancov] Define delimiters for sanitizer coverage's binary section on Windows.
On Windows, the symbols "___stop___sancov_guards" and "___start___sancov_guards" are not defined automatically. So, we need to take a different approach. We define 3 sections: ".SCOV$A", ".SCOV$M" and ".SCOV$Z". Section ".SCOV$A" will only hold a variable ___start___sancov_guard. Section ".SCOV$M" will hold the main data. Section ".SCOV$Z" will only hold a variable ___stop___sancov_guards. When linking, they will be merged sorted by the characters after the $, so we can use the pointers of the variables ___[start|stop]___sancov_guard to know the actual range of addresses of that section. ___[start|stop]___sancov_guard should be defined only once per module. On Windows, we have 2 different cases: + When considering a shared runtime: All the modules, main executable and dlls, are linked to an auxiliary static library dynamic_runtime_thunk.lib. Because of that, we include the delimiters in `SancovDynamicRuntimeThunk`. + When considering a static runtime: The main executable in linked to the static runtime library. All the dlls are linked to an auxiliary static library dll_thunk. Because of that, we include the delimiter to both `SancovDllThunk` and `SANITIZER_LIBCDEP_SOURCES` (which is included in the static runtime lib). Differential Revision: https://reviews.llvm.org/D28435 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@293959 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_mac.cc')
0 files changed, 0 insertions, 0 deletions