From c0693bc2ea90baa6c3abe3f00c42a4dbf819916b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 5 Aug 2009 04:56:58 +0000 Subject: rdar://7119244 - globals with an explicit section specified don't get common linkage. llvm-svn: 78158 --- clang/lib/CodeGen/CodeGenModule.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 08dc9930ba3d..95ce3e5d3af1 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -883,7 +883,8 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) { else if (D->hasAttr()) GV->setLinkage(llvm::GlobalVariable::WeakAnyLinkage); else if (!CompileOpts.NoCommon && - (!D->hasExternalStorage() && !D->getInit())) + !D->hasExternalStorage() && !D->getInit() && + !D->getAttr()) GV->setLinkage(llvm::GlobalVariable::CommonLinkage); else GV->setLinkage(llvm::GlobalVariable::ExternalLinkage); -- cgit v1.2.3