llvm-project/llvm/test/Instrumentation/AddressSanitizer
Reid Kleckner 01660a3d2a [asan] Make ASan compatible with linker dead stripping on Windows
Summary:
This is similar to what was done for Darwin in rL264645 /
http://reviews.llvm.org/D16737, but it uses COFF COMDATs to achive the
same result instead of relying on new custom linker features.

As on MachO, this creates one metadata global per instrumented global.
The metadata global is placed in the custom .ASAN$GL section, which the
ASan runtime will iterate over during initialization. There are no other
references to the metadata, so normal linker dead stripping would
discard it. However, the metadata is put in a COMDAT group with the
instrumented global, so that it will be discarded if and only if the
instrumented global is discarded.

I didn't update the ASan ABI version check since this doesn't affect
non-Windows platforms, and the WinASan ABI isn't really stable yet.

Implementing this for ELF will require extending LLVM IR and MC a bit so
that we can use non-COMDAT section groups.

Reviewers: pcc, kcc, mehdi_amini, kubabrecka

Subscribers: llvm-commits

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

llvm-svn: 287576
2016-11-21 20:40:37 +00:00
..
X86
adaptive_global_redzones.ll
asan-masked-load-store.ll [AddressSanitizer] Add support for (constant-)masked loads and stores. 2016-11-15 22:37:30 +00:00
asan-vs-gvn.ll Do not widen load for different variable in GVN. 2016-09-09 18:42:35 +00:00
asan_address_space_attr.ll [asan] Do not instrument pointers with address space attributes 2016-06-22 00:15:52 +00:00
basic-msvc64.ll [asan] Support dynamic shadow address instrumentation 2016-09-30 17:46:32 +00:00
basic.ll Revert "Change memcpy/memset/memmove to have dest and source alignments." 2015-11-19 05:56:52 +00:00
debug-info-global-var.ll ASAN: Don't drop debug info attachements for global variables. 2016-09-20 18:28:42 +00:00
debug_info.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
debug_info_noninstrumented_alloca.ll [asan] Cleanup instrumentation of dynamic allocas 2016-08-20 17:22:27 +00:00
debug_info_noninstrumented_alloca2.ll [asan] Speed up compilation of large C++ stringmaps (tons of allocas) with ASan 2016-11-08 21:30:41 +00:00
do-not-instrument-globals-darwin.ll [Coverage] Darwin: Move __llvm_covmap from __DATA to __LLVM_COV 2016-10-27 23:17:51 +00:00
do-not-instrument-globals-linux.ll
do-not-instrument-internal-globals.ll
do-not-instrument-profiling-globals.ll [asan] Do not instrument accesses to profiling globals 2016-06-22 17:30:58 +00:00
do-not-instrument-promotable-allocas.ll [asan] Cleanup instrumentation of dynamic allocas 2016-08-20 17:22:27 +00:00
do-not-instrument-sanitizers.ll address comments from: https://reviews.llvm.org/D24566 2016-09-15 15:19:19 +00:00
do-not-touch-comdat-global.ll
do-not-touch-odr-global.ll
do-not-touch-threadlocal.ll
experiment-call.ll
experiment.ll
freebsd.ll
global_cstring_darwin.ll [asan] Move instrumented null-terminated strings to a special section, LLVM part 2016-10-31 18:51:58 +00:00
global_metadata.ll [asan] Support dead code stripping on Mach-O platforms 2016-03-28 20:28:57 +00:00
global_metadata_darwin.ll [asan] Make ASan compatible with linker dead stripping on Windows 2016-11-21 20:40:37 +00:00
global_metadata_windows.ll [asan] Make ASan compatible with linker dead stripping on Windows 2016-11-21 20:40:37 +00:00
instrument-dynamic-allocas.ll [asan] Cleanup instrumentation of dynamic allocas 2016-08-20 17:22:27 +00:00
instrument-no-return.ll
instrument-stack.ll
instrument_global.ll
instrument_initializer_metadata.ll
instrument_load_then_store.ll
instrumentation-with-call-threshold.ll
keep_going.ll
lifetime-throw.ll [asan] Enable new stack poisoning with store instruction by default 2016-08-29 19:28:34 +00:00
lifetime-uar-uas.ll [asan] Enable new stack poisoning with store instruction by default 2016-08-29 19:28:34 +00:00
lifetime.ll Revert "[asan] Avoid lifetime analysis for allocas with can be in ambiguous state" 2016-09-16 01:38:46 +00:00
local_alias.ll [asan] Introduce new hidden -asan-use-private-alias option. 2016-02-08 08:30:57 +00:00
localescape.ll
scale-offset.ll [asan] add option to set shadow mapping offset 2016-05-06 10:25:22 +00:00
stack-poisoning-and-lifetime-be.ll [asan] Rename test file as the poisoning is not "experimental" 2016-10-18 18:05:06 +00:00
stack-poisoning-and-lifetime.ll [asan] Rename test file as the poisoning is not "experimental" 2016-10-18 18:05:06 +00:00
stack-poisoning.ll [asan] Enable new stack poisoning with store instruction by default 2016-08-29 19:28:34 +00:00
stack_dynamic_alloca.ll
stack_layout.ll [asan] Append line number to variable name if line is available and in the same file as the function. 2016-10-18 23:29:41 +00:00
str-nobuiltin.ll [sanitizers] Disable target-specific lowering of string functions. 2016-06-18 10:10:37 +00:00
test64.ll
twice.ll [ASAN] Add doFinalization to reset state 2015-12-05 14:42:34 +00:00
ubsan.ll