diff options
Diffstat (limited to 'llvm/lib/Linker')
-rw-r--r-- | llvm/lib/Linker/IRMover.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/Linker/LinkModules.cpp | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Linker/IRMover.cpp b/llvm/lib/Linker/IRMover.cpp index 9f3cfc0eace..468d86d6e0d 100644 --- a/llvm/lib/Linker/IRMover.cpp +++ b/llvm/lib/Linker/IRMover.cpp @@ -870,9 +870,6 @@ bool IRLinker::shouldLink(GlobalValue *DGV, GlobalValue &SGV) { if (DGV && !DGV->isDeclarationForLinker()) return false; - if (SGV.hasAvailableExternallyLinkage()) - return true; - if (SGV.isDeclaration() || DoneLinkingBodies) return false; diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp index cf2c4ccf523..7ff84db0702 100644 --- a/llvm/lib/Linker/LinkModules.cpp +++ b/llvm/lib/Linker/LinkModules.cpp @@ -425,7 +425,8 @@ void ModuleLinker::addLazyFor(GlobalValue &GV, const IRMover::ValueAdder &Add) { return; // Add these to the internalize list - if (!GV.hasLinkOnceLinkage() && !shouldLinkOnlyNeeded()) + if (!GV.hasLinkOnceLinkage() && !GV.hasAvailableExternallyLinkage() && + !shouldLinkOnlyNeeded()) return; if (shouldInternalizeLinkedSymbols()) |