// 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->hasAvailableExternallyLinkage())
+ I->setSection(getObjFileLowering().
+ SectionForGlobal(I, Mang,TM)->getName());
DbgInfo.BeginModule(M);
EmitFunctionDecls(M);