aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Linker
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-09-09 18:23:48 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-09-09 18:23:48 +0000
commit9435245d3473e850ab60618bd63ad799d1406fe9 (patch)
tree2c8499487682972aae62e62ecf86c320f70f4045 /lib/Linker
parentd0fef97e624b893c0ea9b9c765537dbe7ae80e86 (diff)
downloadexternal_llvm-9435245d3473e850ab60618bd63ad799d1406fe9.zip
external_llvm-9435245d3473e850ab60618bd63ad799d1406fe9.tar.gz
external_llvm-9435245d3473e850ab60618bd63ad799d1406fe9.tar.bz2
Fix incorrect linker behaviour: we shouldn't resolve weak aliases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55997 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Linker')
-rw-r--r--lib/Linker/LinkModules.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp
index 3b319c2..f4ebe6b 100644
--- a/lib/Linker/LinkModules.cpp
+++ b/lib/Linker/LinkModules.cpp
@@ -1169,8 +1169,8 @@ static bool LinkAppendingVars(Module *M,
static bool ResolveAliases(Module *Dest) {
for (Module::alias_iterator I = Dest->alias_begin(), E = Dest->alias_end();
I != E; ++I)
- if (const GlobalValue *GV = I->resolveAliasedGlobal())
- if (!GV->isDeclaration())
+ if (const GlobalValue *GV = I->resolveAliasedGlobal(/*traverseWeak*/ false))
+ if (GV != I && !GV->isDeclaration())
I->replaceAllUsesWith(const_cast<GlobalValue*>(GV));
return false;