diff --git a/lib/Target/PIC16/PIC16AsmPrinter.cpp b/lib/Target/PIC16/PIC16AsmPrinter.cpp index ea4515696a5..f0e4cbaae6a 100644 --- a/lib/Target/PIC16/PIC16AsmPrinter.cpp +++ b/lib/Target/PIC16/PIC16AsmPrinter.cpp @@ -238,7 +238,9 @@ bool PIC16AsmPrinter::doInitialization(Module &M) { // 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);