LinkOnce definitions have default scope, like weak definitions. Otherwise, the linker may not be able to match LinkOnce definition from one module with an exteranl reference from other module.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53580 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2008-07-15 00:00:11 +00:00
parent 5f2f218825
commit f0d286b77f

View File

@ -224,7 +224,8 @@ void LTOModule::addDefinedSymbol(GlobalValue* def, Mangler &mangler,
// set scope part
if ( def->hasHiddenVisibility() )
attr |= LTO_SYMBOL_SCOPE_HIDDEN;
else if ( def->hasExternalLinkage() || def->hasWeakLinkage() )
else if ( def->hasExternalLinkage() || def->hasWeakLinkage()
|| def->hasLinkOnceLinkage() )
attr |= LTO_SYMBOL_SCOPE_DEFAULT;
else
attr |= LTO_SYMBOL_SCOPE_INTERNAL;