From 9435245d3473e850ab60618bd63ad799d1406fe9 Mon Sep 17 00:00:00 2001 From: Anton Korobeynikov Date: Tue, 9 Sep 2008 18:23:48 +0000 Subject: 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 --- lib/Linker/LinkModules.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/Linker') 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(GV)); return false; -- cgit v1.1