diff --git a/tools/llvm-nm/llvm-nm.cpp b/tools/llvm-nm/llvm-nm.cpp index 63fa75d884f..008c2e0431f 100644 --- a/tools/llvm-nm/llvm-nm.cpp +++ b/tools/llvm-nm/llvm-nm.cpp @@ -70,6 +70,7 @@ namespace { static char TypeCharForSymbol(GlobalValue &GV) { if (GV.isDeclaration()) return 'U'; if (GV.hasLinkOnceLinkage()) return 'C'; + if (GV.hasCommonLinkage()) return 'C'; if (GV.hasWeakLinkage()) return 'W'; if (isa(GV) && GV.hasInternalLinkage()) return 't'; if (isa(GV)) return 'T'; diff --git a/tools/lto/lto.cpp b/tools/lto/lto.cpp index d2cb3b8b43c..0a962fce1dd 100644 --- a/tools/lto/lto.cpp +++ b/tools/lto/lto.cpp @@ -65,7 +65,7 @@ void LLVMSymbol::mayBeNotUsed() { gv->setLinkage(GlobalValue::InternalLinkage); } -// Map LLVM LinkageType to LTO LinakgeType +// Map LLVM LinkageType to LTO LinkageType static LTOLinkageTypes getLTOLinkageType(GlobalValue *v) { @@ -76,6 +76,8 @@ getLTOLinkageType(GlobalValue *v) lt = LTOLinkOnceLinkage; else if (v->hasWeakLinkage()) lt = LTOWeakLinkage; + else if (v->hasCommonLinkage()) + lt = LTOCommonLinkage; else // Otherwise it is internal linkage for link time optimizer lt = LTOInternalLinkage;