summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2015-06-25 23:35:48 +0000
committerAnna Zaks <ganna@apple.com>2015-06-25 23:35:48 +0000
commit785c075786afef3863c00b3691bab4c678a19fb3 (patch)
treee1271d49ac72eb207e00679095cd33c08afce1d9 /llvm/lib
parent4f652b69b110de48e07ea334f4d41f83bc4784b2 (diff)
downloadbcm5719-llvm-785c075786afef3863c00b3691bab4c678a19fb3.tar.gz
bcm5719-llvm-785c075786afef3863c00b3691bab4c678a19fb3.zip
[asan] Do not instrument special purpose LLVM sections.
Do not instrument globals that are placed in sections containing "__llvm" in their name. This fixes a bug in ASan / PGO interoperability. ASan interferes with LLVM's PGO, which places its globals into a special section, which is memcpy-ed by the linker as a whole. When those goals are instrumented, ASan's memcpy wrapper reports an issue. http://reviews.llvm.org/D10541 llvm-svn: 240723
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
index ff4368198be..92b13c49ede 100644
--- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -1144,6 +1144,8 @@ bool AddressSanitizerModule::ShouldInstrumentGlobal(GlobalVariable *G) {
// Globals from llvm.metadata aren't emitted, do not instrument them.
if (Section == "llvm.metadata") return false;
+ // Do not instrument globals from special LLVM sections.
+ if (Section.find("__llvm") != StringRef::npos) return false;
// Callbacks put into the CRT initializer/terminator sections
// should not be instrumented.
OpenPOWER on IntegriCloud