Index: lib/Linker/LinkModules.cpp =================================================================== --- lib/Linker/LinkModules.cpp +++ lib/Linker/LinkModules.cpp @@ -593,6 +593,13 @@ for (auto &P : Internalize) { GlobalValue *GV = DstM.getNamedValue(P.first()); + + if (GV->hasName() && + (GV->getName() == "llvm.global_ctors" || + GV->getName() == "llvm.global_dtors" || GV->getName() == "llvm.used" || + GV->getName() == "llvm.compiler.used")) + continue; + GV->setLinkage(GlobalValue::InternalLinkage); }