OSDN Git Service

[asan] Instrument comdat globals on COFF targets
authorReid Kleckner <rnk@google.com>
Fri, 8 Jun 2018 18:33:16 +0000 (18:33 +0000)
committerReid Kleckner <rnk@google.com>
Fri, 8 Jun 2018 18:33:16 +0000 (18:33 +0000)
commit98c78e82f54be8fb0bb5f02e3ca674fbde10ef34
tree788539f13c31aeafb0881e15f3d9832092dc0a35
parent6ad988b59984b2de21b1646e071d4d71b787ef5b
[asan] Instrument comdat globals on COFF targets

Summary:
If we can use comdats, then we can make it so that the global metadata
is thrown away if the prevailing definition of the global was
uninstrumented. I have only tested this on COFF targets, but in theory,
there is no reason that we cannot also do this for ELF.

This will allow us to re-enable string merging with ASan on Windows,
reducing the binary size cost of ASan on Windows.

Reviewers: eugenis, vitalybuka

Subscribers: hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334313 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Instrumentation/AddressSanitizer.cpp
test/Instrumentation/AddressSanitizer/win-string-literal.ll [new file with mode: 0644]