OSDN Git Service

[ASAN] Add the binder globals on Darwin to llvm.compiler.used to avoid LTO dead-stripping
authorMehdi Amini <mehdi.amini@apple.com>
Sat, 1 Oct 2016 00:05:34 +0000 (00:05 +0000)
committerMehdi Amini <mehdi.amini@apple.com>
Sat, 1 Oct 2016 00:05:34 +0000 (00:05 +0000)
commit090f75dc839cbe1d94c8445bf8fabd0f19309f25
tree34408ab1f640c2d53f64ad523cfe849459f0cbea
parentb6b3db73a6abf94cde571cfd3e47980c20fbd678
[ASAN] Add the binder globals on Darwin to llvm.compiler.used to avoid LTO dead-stripping

The binder is in a specific section that "reverse" the edges in a
regular dead-stripping: the binder is live as long as a global it
references is live.

This is a big hammer that prevents LLVM from dead-stripping these,
while still allowing linker dead-stripping (with special knowledge
of the section).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282988 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Instrumentation/AddressSanitizer.cpp
test/Instrumentation/AddressSanitizer/global_metadata_darwin.ll