diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index 5aa06abdd98..f372db2403c 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.cpp @@ -505,6 +505,7 @@ static bool LinkGlobals(Module *Dest, const Module *Src, SGV->getType()->getAddressSpace()); // Propagate alignment, visibility and section info. CopyGVAttributes(NewDGV, SGV); + NewDGV->setUnnamedAddr(SGV->hasUnnamedAddr()); // If the LLVM runtime renamed the global, but it is an externally visible // symbol, DGV must be an existing global with internal linkage. Rename