[llvm-commits] [llvm] r77354 - in /llvm/trunk/lib/CodeGen: ELFCodeEmitter.cpp ELFWriter.cpp
Bruno Cardoso Lopes
bruno.cardoso at gmail.com
Tue Jul 28 12:25:33 PDT 2009
Author: bruno
Date: Tue Jul 28 14:25:33 2009
New Revision: 77354
URL: http://llvm.org/viewvc/llvm-project?rev=77354&view=rev
Log:
Handle null and file symbol on doInitialization
Modified:
llvm/trunk/lib/CodeGen/ELFCodeEmitter.cpp
llvm/trunk/lib/CodeGen/ELFWriter.cpp
Modified: llvm/trunk/lib/CodeGen/ELFCodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ELFCodeEmitter.cpp?rev=77354&r1=77353&r2=77354&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ELFCodeEmitter.cpp (original)
+++ llvm/trunk/lib/CodeGen/ELFCodeEmitter.cpp Tue Jul 28 14:25:33 2009
@@ -36,7 +36,7 @@
/// 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.
Modified: llvm/trunk/lib/CodeGen/ELFWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ELFWriter.cpp?rev=77354&r1=77353&r2=77354&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ELFWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/ELFWriter.cpp Tue Jul 28 14:25:33 2009
@@ -143,6 +143,11 @@
// 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;
}
@@ -189,7 +194,7 @@
const TargetLoweringObjectFile &TLOF =
TM.getTargetLowering()->getObjFileLowering();
-
+
return getSection(TLOF.getSectionForMergeableConstant(Kind)->getName(),
ELFSection::SHT_PROGBITS,
ELFSection::SHF_MERGE | ELFSection::SHF_ALLOC,
@@ -320,7 +325,7 @@
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());
@@ -522,9 +527,6 @@
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];
@@ -798,9 +800,6 @@
// 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();
More information about the llvm-commits
mailing list