declaration will end up in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77843
91177308-0d34-0410-b5e6-
96231b3b80d8
// Set the section names for all globals.
for (Module::global_iterator I = M.global_begin(), E = M.global_end();
I != E; ++I)
- I->setSection(getObjFileLowering().SectionForGlobal(I, Mang,TM)->getName());
+ if (!I->isDeclaration())
+ I->setSection(getObjFileLowering().
+ SectionForGlobal(I, Mang,TM)->getName());
DbgInfo.BeginModule(M);
EmitFunctionDecls(M);