mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-03-03 01:48:15 +00:00
Fix PR245: Linking weak and strong global variables is dependent on link order
llvm-svn: 11565
This commit is contained in:
parent
d9e1a49650
commit
4fa2e7a67f
@ -566,7 +566,6 @@ static bool LinkGlobalInits(Module *Dest, const Module *Src,
|
||||
|
||||
GlobalVariable *DGV = cast<GlobalVariable>(ValueMap[SGV]);
|
||||
if (DGV->hasInitializer()) {
|
||||
assert(SGV->getLinkage() == DGV->getLinkage());
|
||||
if (SGV->hasExternalLinkage()) {
|
||||
if (DGV->getInitializer() != SInit)
|
||||
return Error(Err, "Global Variable Collision on '" +
|
||||
@ -575,6 +574,9 @@ static bool LinkGlobalInits(Module *Dest, const Module *Src,
|
||||
} else if (DGV->hasLinkOnceLinkage() || DGV->hasWeakLinkage()) {
|
||||
// Nothing is required, mapped values will take the new global
|
||||
// automatically.
|
||||
} else if (SGV->hasLinkOnceLinkage() || SGV->hasWeakLinkage()) {
|
||||
// Nothing is required, mapped values will take the new global
|
||||
// automatically.
|
||||
} else if (DGV->hasAppendingLinkage()) {
|
||||
assert(0 && "Appending linkage unimplemented!");
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user