[ASan] Don't instrument globals in .preinit_array/.init_array/.fini_array
authorAlexey Samsonov <vonosmas@gmail.com>
Tue, 15 Sep 2015 23:05:48 +0000 (23:05 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Tue, 15 Sep 2015 23:05:48 +0000 (23:05 +0000)
commitda2c6c300aff5f309e8a50f329ddae79704dec4f
tree8f40d65dc85605d41ccdbf35ec38ea49f61f4c2f
parentc567bd6ca294236dc93121eddeb01c1ddca39c73
[ASan] Don't instrument globals in .preinit_array/.init_array/.fini_array

These sections contain pointers to function that should be invoked
during startup/shutdown by __libc_csu_init and __libc_csu_fini.
Instrumenting these globals will append redzone to them, which will be
filled with zeroes. This will cause null pointer dereference at runtime.

Merge ASan regression tests for globals that should be ignored by
instrumentation pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247734 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Instrumentation/AddressSanitizer.cpp
test/Instrumentation/AddressSanitizer/do-not-instrument-cstring.ll [deleted file]
test/Instrumentation/AddressSanitizer/do-not-instrument-globals-darwin.ll [new file with mode: 0644]
test/Instrumentation/AddressSanitizer/do-not-instrument-globals-linux.ll [new file with mode: 0644]
test/Instrumentation/AddressSanitizer/do-not-instrument-llvm-metadata-darwin.ll [deleted file]
test/Instrumentation/AddressSanitizer/do-not-instrument-llvm-metadata.ll [deleted file]