summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-05-07 22:55:46 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-05-07 22:55:46 +0000
commitb2becfdbaee499538f4d1c8aa514daa29e3c6b6d (patch)
tree0faa8cd40306c945401d600ef7d39518f6ab9285
parent87121f84d2fd0f3cfb6c6f7c99aeb7d22c665b74 (diff)
downloadbcm5719-llvm-b2becfdbaee499538f4d1c8aa514daa29e3c6b6d.tar.gz
bcm5719-llvm-b2becfdbaee499538f4d1c8aa514daa29e3c6b6d.zip
LTO: Assert visibility of local linkage when merging symbols
`ModuleLinker::getLinkageResult()` shouldn't create symbols with local linkage and non-default visibility -- in fact, symbols with local linkage shouldn't be merged at all. Assert to that effect. llvm-svn: 208262
-rw-r--r--llvm/lib/Linker/LinkModules.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp
index 55654ac25d6..49c5e1cc13e 100644
--- a/llvm/lib/Linker/LinkModules.cpp
+++ b/llvm/lib/Linker/LinkModules.cpp
@@ -604,6 +604,8 @@ bool ModuleLinker::getLinkageResult(GlobalValue *Dest, const GlobalValue *Src,
// Compute the visibility. We follow the rules in the System V Application
// Binary Interface.
+ assert(!GlobalValue::isLocalLinkage(LT) &&
+ "Symbols with local linkage should not be merged");
Vis = isLessConstraining(Src->getVisibility(), Dest->getVisibility()) ?
Dest->getVisibility() : Src->getVisibility();
return false;
OpenPOWER on IntegriCloud