diff --git a/llvm/lib/Transforms/Utils/Linker.cpp b/llvm/lib/Transforms/Utils/Linker.cpp index 13afe1fa93c35d6cda65d1f50f342ccceecc0d03..c4d4fc64ce88554c7788aff4335fe31c3e5b0d2b 100644 --- a/llvm/lib/Transforms/Utils/Linker.cpp +++ b/llvm/lib/Transforms/Utils/Linker.cpp @@ -597,7 +597,8 @@ bool LinkModules(Module *Dest, const Module *Src, std::string *ErrorMsg) { // Add all of the appending globals already in the Dest module to // AppendingVars. for (Module::giterator I = Dest->gbegin(), E = Dest->gend(); I != E; ++I) - AppendingVars.insert(std::make_pair(I->getName(), I)); + if (I->hasAppendingLinkage()) + AppendingVars.insert(std::make_pair(I->getName(), I)); // Insert all of the globals in src into the Dest module... without linking // initializers (which could refer to functions not yet mapped over).