mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
Added some debugging support via Linker::dumpSymbols().
This commit is contained in:
parent
8f7f1135df
commit
a61457b422
|
@ -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);
|
||||
|
|
|
@ -86,6 +86,7 @@ public:
|
|||
virtual void relocate();
|
||||
virtual void defineSymbol(const char *name, unsigned value);
|
||||
virtual unsigned getSymbolOffset(const char *) const;
|
||||
virtual void dumpSymbols(FILE *fp=NULL) const;
|
||||
|
||||
void alignWithByte(unsigned len, upx_byte b);
|
||||
virtual void alignCode(unsigned len) { alignWithByte(len, 0); }
|
||||
|
|
|
@ -603,6 +603,7 @@ PackLinuxElf64amd::defineSymbols(Filter const *)
|
|||
#undef PAGE_SIZE
|
||||
#undef PAGE_MASK
|
||||
|
||||
linker->dumpSymbols();
|
||||
}
|
||||
|
||||
static const
|
||||
|
|
Loading…
Reference in New Issue
Block a user