diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2011-02-01 05:33:52 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2011-02-01 05:33:52 +0000 |
commit | 4e93885bab8c3738fdad3286e99dc147157218e8 (patch) | |
tree | 4396ae2b4f1b6bb28d39562abb0e13f8caa192d1 /lib/Linker | |
parent | e087afa128211285ee41297fa5fc22fe5f2d3eb1 (diff) | |
download | external_llvm-4e93885bab8c3738fdad3286e99dc147157218e8.zip external_llvm-4e93885bab8c3738fdad3286e99dc147157218e8.tar.gz external_llvm-4e93885bab8c3738fdad3286e99dc147157218e8.tar.bz2 |
Correctly merge available_externally and regular definitions when they have
different visibilities.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124650 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Linker')
-rw-r--r-- | lib/Linker/LinkModules.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index ec39c93..5aa06ab 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.cpp @@ -434,8 +434,10 @@ static bool GetLinkageResult(GlobalValue *Dest, const GlobalValue *Src, } // Check visibility - if (Dest && Src->getVisibility() != Dest->getVisibility()) - if (!Src->isDeclaration() && !Dest->isDeclaration()) + if (Dest && Src->getVisibility() != Dest->getVisibility() && + !Src->isDeclaration() && !Dest->isDeclaration() && + !Src->hasAvailableExternallyLinkage() && + !Dest->hasAvailableExternallyLinkage()) return Error(Err, "Linking globals named '" + Src->getName() + "': symbols have different visibilities!"); return false; |