[ASan] Use llvm.global_ctors to insert init-order checking calls into ASan runtime.
authorAlexey Samsonov <vonosmas@gmail.com>
Thu, 29 May 2014 00:51:15 +0000 (00:51 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Thu, 29 May 2014 00:51:15 +0000 (00:51 +0000)
commit96e239f564bcc6dcf98f715396f3e0c5083e9e64
treed251a2787992debe1fe9d74799b1b76805b80f40
parent304a36b5fc3143aedfac9b966af4261dc73b3315
[ASan] Use llvm.global_ctors to insert init-order checking calls into ASan runtime.

Don't assume that dynamically initialized globals are all initialized from
_GLOBAL__<module_name>I_ function. Instead, scan the llvm.global_ctors and
insert poison/unpoison calls to each function there.

Patch by Nico Weber!

llvm-svn: 209780
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
llvm/test/Instrumentation/AddressSanitizer/instrument_initializer_metadata.ll