diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2014-05-29 00:51:15 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2014-05-29 00:51:15 +0000 |
commit | b18eabd2d88e95746c83a88d76ab31fed1e2903c (patch) | |
tree | f2991e6c3c582fd58ddfdb29c820c748783abc7d /test/Instrumentation | |
parent | 1d4e8baa9c7f9dfc14156a762d2cd0016ceca034 (diff) | |
download | llvm-b18eabd2d88e95746c83a88d76ab31fed1e2903c.tar.gz llvm-b18eabd2d88e95746c83a88d76ab31fed1e2903c.tar.bz2 llvm-b18eabd2d88e95746c83a88d76ab31fed1e2903c.tar.xz |
[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!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209780 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Instrumentation')
-rw-r--r-- | test/Instrumentation/AddressSanitizer/instrument_initializer_metadata.ll | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/Instrumentation/AddressSanitizer/instrument_initializer_metadata.ll b/test/Instrumentation/AddressSanitizer/instrument_initializer_metadata.ll index 1d00cfacaf..05e18b5a01 100644 --- a/test/Instrumentation/AddressSanitizer/instrument_initializer_metadata.ll +++ b/test/Instrumentation/AddressSanitizer/instrument_initializer_metadata.ll @@ -23,6 +23,8 @@ entry: ret void } +@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a }] + define internal void @_GLOBAL__I_a() sanitize_address section ".text.startup" { entry: call void @__cxx_global_var_init() |