From 76be5dd1d30870393f10f1226794a70f5129ba74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Moln=C3=A1r?= Date: Sun, 1 Sep 2013 21:38:44 +0200 Subject: [PATCH] linker: Section::offset should be u64 --- src/linker.cpp | 8 ++++---- src/linker.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/linker.cpp b/src/linker.cpp index 26a1aa21..2d164336 100644 --- a/src/linker.cpp +++ b/src/linker.cpp @@ -549,8 +549,8 @@ void ElfLinker::dumpSymbol(const Symbol *symbol, unsigned flags, FILE *fp) const { if ((flags & 1) && symbol->section->output == NULL) return; - fprintf(fp, "%-28s 0x%16llx | %-28s 0x%08x\n", - symbol->name, (unsigned long long) symbol->offset, symbol->section->name, symbol->section->offset); + fprintf(fp, "%-28s 0x%016llx | %-28s 0x%016llx\n", + symbol->name, (unsigned long long) symbol->offset, symbol->section->name, (unsigned long long) symbol->section->offset); } 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 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++) { 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); if (symbol->section->output == NULL) diff --git a/src/linker.h b/src/linker.h index 445a33e7..454cc141 100644 --- a/src/linker.h +++ b/src/linker.h @@ -95,7 +95,7 @@ public: virtual int getSectionSize(const char *sname) const; virtual upx_byte *getLoader(int *llen=NULL) const; 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 dumpSymbols(unsigned flags=0, FILE *fp=NULL) const; @@ -125,7 +125,7 @@ struct ElfLinker::Section : private noncopyable void *input; upx_byte *output; unsigned size; - unsigned offset; + u64 offset; unsigned p2align; // log2 Section *next;