Added some debugging support via Linker::dumpSymbols().

This commit is contained in:
Markus F.X.J. Oberhumer
2006-10-03 23:48:19 +02:00
parent 8f7f1135df
commit a61457b422
3 changed files with 15 additions and 0 deletions
+13
View File
@@ -443,6 +443,19 @@ void ElfLinker::defineSymbol(const char *name, unsigned value)
}
}
// debugging support
void ElfLinker::dumpSymbols(FILE *fp) const
{
if (fp == NULL)
fp = stdout;
for (unsigned ic = 0; ic < nsymbols; ic++)
{
Symbol *symbol = symbols[ic];
fprintf(fp, "%-20s 0x%08lx | %-20s 0x%08lx\n",
symbol->name, symbol->offset, symbol->section->name, symbol->section->offset);
}
}
unsigned ElfLinker::getSymbolOffset(const char *name) const
{
assert(frozen);