[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)
commit6610b01a278198fecf79503c1761eabbf60d56f2
treeee0833c9fa0f19b26ea700530989f53e450309a0
parent9d4ed262ef0a04b4b92980c852c11a5d50ecdfd9
[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

llvm-svn: 282988
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
llvm/test/Instrumentation/AddressSanitizer/global_metadata_darwin.ll