/// startFunction - This callback is invoked when a new machine function is
/// about to be emitted.
void ELFCodeEmitter::startFunction(MachineFunction &MF) {
- DEBUG(errs() << "processing function: "
+ DEBUG(errs() << "processing function: "
<< MF.getFunction()->getName() << "\n");
// Get the ELF Section that this function belongs in.
// Add the null section, which is required to be first in the file.
getNullSection();
+ // The first entry in the symtab is the null symbol and the second
+ // is a local symbol containing the module/file name
+ SymbolList.push_back(new ELFSym());
+ SymbolList.push_back(ELFSym::getFileSym());
+
return false;
}
const TargetLoweringObjectFile &TLOF =
TM.getTargetLowering()->getObjFileLowering();
-
+
return getSection(TLOF.getSectionForMergeableConstant(Kind)->getName(),
ELFSection::SHT_PROGBITS,
ELFSection::SHF_MERGE | ELFSection::SHF_ALLOC,
const TargetLoweringObjectFile &TLOF =
TM.getTargetLowering()->getObjFileLowering();
- // Get ELF section from TAI
+ // Get the ELF section where this global belongs from TLOF
const Section *S = TLOF.SectionForGlobal(GV, TM);
unsigned SectionFlags = getElfSectionFlags(S->getKind());
if (TAI->getNonexecutableStackDirective())
getNonExecStackSection();
- // Emit module name
- SymbolList.push_back(ELFSym::getFileSym());
-
// Emit a symbol for each section created until now, skip null section
for (unsigned i = 1, e = SectionList.size(); i < e; ++i) {
ELFSection &ES = *SectionList[i];
// Size of each symtab entry.
SymTab.EntSize = TEW->getSymTabEntrySize();
- // The first entry in the symtab is the null symbol
- SymbolList.insert(SymbolList.begin(), new ELFSym());
-
// Reorder the symbol table with local symbols first!
unsigned FirstNonLocalSymbol = SortSymbols();