hanchenye-llvm-project/llvm
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
..
bindings Fix go binding to adapt the new attribute API 2016-11-18 10:11:02 +00:00
cmake [CMake] Apply sandbox profile to target not directory 2016-11-19 01:32:09 +00:00
docs Timer: Track name and description. 2016-11-18 19:43:18 +00:00
examples ExceptionDemo: remove some undefined behaviour 2016-11-20 02:36:38 +00:00
include [MemorySSA] Fix for non-determinism in codegen 2016-11-21 19:33:02 +00:00
lib [asan] Make ASan compatible with linker dead stripping on Windows 2016-11-21 20:40:37 +00:00
projects
resources
runtimes
test [asan] Make ASan compatible with linker dead stripping on Windows 2016-11-21 20:40:37 +00:00
tools [llvm-cov] Avoid 0% when reporting something that's 0/0 2016-11-21 14:00:04 +00:00
unittests Fix spelling mistakes in Tools/Tests comments. NFC. 2016-11-20 13:31:13 +00:00
utils [Sparc] Use target name instead of namespace as prefix for MCRegisterClasses array 2016-11-21 09:33:05 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitignore
CMakeLists.txt Add an option to disable libedit 2016-11-18 01:25:49 +00:00
CODE_OWNERS.TXT CODE_OWNERS: Take ownership of the X86 backend. 2016-11-12 05:16:06 +00:00
CREDITS.TXT Give SLP vectorizer credit where it's due. 2016-11-14 19:01:59 +00:00
LICENSE.TXT
LLVMBuild.txt
README.txt Test commit, deleted empty line at the end of README.txt 2016-11-07 18:31:21 +00:00
RELEASE_TESTERS.TXT
configure
llvm.spec.in

README.txt

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.