summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Linker/LinkModules.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Linker/LinkModules.cpp')
-rw-r--r--llvm/lib/Linker/LinkModules.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp
index b7aab9e9644..a855ec06d17 100644
--- a/llvm/lib/Linker/LinkModules.cpp
+++ b/llvm/lib/Linker/LinkModules.cpp
@@ -841,10 +841,12 @@ GlobalValue *ModuleLinker::copyGlobalAliasProto(TypeMapTy &TypeMap,
assert(F);
NewGV = copyFunctionProto(TypeMap, F);
}
- // Set the linkage to ExternalWeak, see also comments in
- // ModuleLinker::getLinkage.
+ // Set the linkage to External or ExternalWeak (see comments in
+ // ModuleLinker::getLinkage for why WeakAny is converted to ExternalWeak).
if (SGA->hasWeakAnyLinkage())
NewGV->setLinkage(GlobalValue::ExternalWeakLinkage);
+ else
+ NewGV->setLinkage(GlobalValue::ExternalLinkage);
// Don't attempt to link body, needs to be a declaration.
DoNotLinkFromSource.insert(SGA);
return NewGV;
OpenPOWER on IntegriCloud