linker: Section::offset should be u64
This commit is contained in:
+4
-4
@@ -549,8 +549,8 @@ void ElfLinker::dumpSymbol(const Symbol *symbol, unsigned flags, FILE *fp) const
|
|||||||
{
|
{
|
||||||
if ((flags & 1) && symbol->section->output == NULL)
|
if ((flags & 1) && symbol->section->output == NULL)
|
||||||
return;
|
return;
|
||||||
fprintf(fp, "%-28s 0x%16llx | %-28s 0x%08x\n",
|
fprintf(fp, "%-28s 0x%016llx | %-28s 0x%016llx\n",
|
||||||
symbol->name, (unsigned long long) symbol->offset, symbol->section->name, symbol->section->offset);
|
symbol->name, (unsigned long long) symbol->offset, symbol->section->name, (unsigned long long) symbol->section->offset);
|
||||||
}
|
}
|
||||||
void ElfLinker::dumpSymbols(unsigned flags, FILE *fp) const
|
void ElfLinker::dumpSymbols(unsigned flags, FILE *fp) const
|
||||||
{
|
{
|
||||||
@@ -561,7 +561,7 @@ void ElfLinker::dumpSymbols(unsigned flags, FILE *fp) const
|
|||||||
// default: dump symbols in used section order
|
// default: dump symbols in used section order
|
||||||
for (const Section *section = head; section; section = section->next)
|
for (const Section *section = head; section; section = section->next)
|
||||||
{
|
{
|
||||||
fprintf(fp, "%-42s%-28s 0x%08x\n", "", section->name, section->offset);
|
fprintf(fp, "%-42s%-28s 0x%016llx\n", "", section->name, (unsigned long long) section->offset);
|
||||||
for (unsigned ic = 0; ic < nsymbols; ic++)
|
for (unsigned ic = 0; ic < nsymbols; ic++)
|
||||||
{
|
{
|
||||||
const Symbol *symbol = symbols[ic];
|
const Symbol *symbol = symbols[ic];
|
||||||
@@ -578,7 +578,7 @@ void ElfLinker::dumpSymbols(unsigned flags, FILE *fp) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned ElfLinker::getSymbolOffset(const char *name) const
|
ElfLinker::u64 ElfLinker::getSymbolOffset(const char *name) const
|
||||||
{
|
{
|
||||||
const Symbol *symbol = findSymbol(name);
|
const Symbol *symbol = findSymbol(name);
|
||||||
if (symbol->section->output == NULL)
|
if (symbol->section->output == NULL)
|
||||||
|
|||||||
+2
-2
@@ -95,7 +95,7 @@ public:
|
|||||||
virtual int getSectionSize(const char *sname) const;
|
virtual int getSectionSize(const char *sname) const;
|
||||||
virtual upx_byte *getLoader(int *llen=NULL) const;
|
virtual upx_byte *getLoader(int *llen=NULL) const;
|
||||||
virtual void defineSymbol(const char *name, u64 value);
|
virtual void defineSymbol(const char *name, u64 value);
|
||||||
virtual unsigned getSymbolOffset(const char *) const;
|
virtual u64 getSymbolOffset(const char *) const;
|
||||||
|
|
||||||
virtual void dumpSymbol(const Symbol *, unsigned flags, FILE *fp) const;
|
virtual void dumpSymbol(const Symbol *, unsigned flags, FILE *fp) const;
|
||||||
virtual void dumpSymbols(unsigned flags=0, FILE *fp=NULL) const;
|
virtual void dumpSymbols(unsigned flags=0, FILE *fp=NULL) const;
|
||||||
@@ -125,7 +125,7 @@ struct ElfLinker::Section : private noncopyable
|
|||||||
void *input;
|
void *input;
|
||||||
upx_byte *output;
|
upx_byte *output;
|
||||||
unsigned size;
|
unsigned size;
|
||||||
unsigned offset;
|
u64 offset;
|
||||||
unsigned p2align; // log2
|
unsigned p2align; // log2
|
||||||
Section *next;
|
Section *next;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user