summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Instrumentation
diff options
context:
space:
mode:
authorMike Aizatsky <aizatsky@chromium.org>2017-02-08 21:20:33 +0000
committerMike Aizatsky <aizatsky@chromium.org>2017-02-08 21:20:33 +0000
commit401d3693286103fd76d622ee9cd8f8a7df934bdd (patch)
treee6b39dfc97fe02e9c757bd2c7669725b47dc728f /llvm/lib/Transforms/Instrumentation
parent40540a43b27bb67b94128477e67914ad78446614 (diff)
downloadbcm5719-llvm-401d3693286103fd76d622ee9cd8f8a7df934bdd.tar.gz
bcm5719-llvm-401d3693286103fd76d622ee9cd8f8a7df934bdd.zip
[sancov] specifying comdat for sancov constructors
Differential Revision: https://reviews.llvm.org/D29662 llvm-svn: 294517
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation')
-rw-r--r--llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp b/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
index ee5158fa1d5..76e5f8bd660 100644
--- a/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
+++ b/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
@@ -382,7 +382,9 @@ bool SanitizerCoverageModule::runOnModule(Module &M) {
{IRB.CreatePointerCast(SecStart, Int32PtrTy),
IRB.CreatePointerCast(SecEnd, Int32PtrTy)});
- appendToGlobalCtors(M, CtorFunc, SanCtorAndDtorPriority);
+ // Use comdat to dedup CtorFunc.
+ CtorFunc->setComdat(M.getOrInsertComdat(SanCovModuleCtorName));
+ appendToGlobalCtors(M, CtorFunc, SanCtorAndDtorPriority, CtorFunc);
}
} else if (!Options.TracePC) {
Function *CtorFunc;
OpenPOWER on IntegriCloud