diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-05-07 22:55:46 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-05-07 22:55:46 +0000 |
commit | c7e175a743babd383384aa3ca870f2406a8861da (patch) | |
tree | 203c916f85d5573911464f59c6ac72c0a27bbee5 /lib/Linker | |
parent | 83533dd617a1d1ba0e43f60d161f3813d39a6fb0 (diff) | |
download | llvm-c7e175a743babd383384aa3ca870f2406a8861da.tar.gz llvm-c7e175a743babd383384aa3ca870f2406a8861da.tar.bz2 llvm-c7e175a743babd383384aa3ca870f2406a8861da.tar.xz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208262 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Linker')
-rw-r--r-- | lib/Linker/LinkModules.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index 55654ac25d..49c5e1cc13 100644 --- a/lib/Linker/LinkModules.cpp +++ b/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; |