aboutsummaryrefslogtreecommitdiff
path: root/tools/llvm-objdump
diff options
context:
space:
mode:
authorDanil Malyshev <dmalyshev@accesssoftek.com>2011-11-29 17:40:10 +0000
committerDanil Malyshev <dmalyshev@accesssoftek.com>2011-11-29 17:40:10 +0000
commitb0436a73054fe676b216a0cf872d1fc433125c62 (patch)
treee563af80f77645faaa3f82c5026a50d46da03047 /tools/llvm-objdump
parentf68b214e2d06849091b5ff3dd5d5efe29722dcc3 (diff)
Fixed ObjectFile functions:
- getSymbolOffset() renamed as getSymbolFileOffset() - getSymbolFileOffset(), getSymbolAddress(), getRelocationAddress() returns same result for ELFObjectFile, MachOObjectFile and COFFObjectFile. - added getRelocationOffset() - fixed MachOObjectFile::getSymbolSize() - fixed MachOObjectFile::getSymbolSection() - fixed MachOObjectFile::getSymbolOffset() for symbols without section data. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145408 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-objdump')
-rw-r--r--tools/llvm-objdump/MachODump.cpp4
-rw-r--r--tools/llvm-objdump/llvm-objdump.cpp14
2 files changed, 10 insertions, 8 deletions
diff --git a/tools/llvm-objdump/MachODump.cpp b/tools/llvm-objdump/MachODump.cpp
index 4ccae5148b..ffeea88bdc 100644
--- a/tools/llvm-objdump/MachODump.cpp
+++ b/tools/llvm-objdump/MachODump.cpp
@@ -419,7 +419,7 @@ void llvm::DisassembleInputMachO(StringRef Filename) {
// Start at the address of the symbol relative to the section's address.
uint64_t Start = 0;
- Symbols[SymIdx].getOffset(Start);
+ Symbols[SymIdx].getAddress(Start);
// Stop disassembling either at the beginning of the next symbol or at
// the end of the section.
@@ -432,7 +432,7 @@ void llvm::DisassembleInputMachO(StringRef Filename) {
if (NextSymType == SymbolRef::ST_Function) {
Sections[SectIdx].containsSymbol(Symbols[NextSymIdx],
containsNextSym);
- Symbols[NextSymIdx].getOffset(NextSym);
+ Symbols[NextSymIdx].getAddress(NextSym);
break;
}
++NextSymIdx;
diff --git a/tools/llvm-objdump/llvm-objdump.cpp b/tools/llvm-objdump/llvm-objdump.cpp
index 9071d58b0e..bcfecb36e8 100644
--- a/tools/llvm-objdump/llvm-objdump.cpp
+++ b/tools/llvm-objdump/llvm-objdump.cpp
@@ -186,7 +186,7 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) {
bool contains;
if (!error(i->containsSymbol(*si, contains)) && contains) {
uint64_t Address;
- if (error(si->getOffset(Address))) break;
+ if (error(si->getAddress(Address))) break;
StringRef Name;
if (error(si->getName(Name))) break;
Symbols.push_back(std::make_pair(Address, Name));
@@ -477,7 +477,7 @@ static void PrintSymbolTable(const ObjectFile *o) {
se = o->end_symbols(); si != se; si.increment(ec)) {
if (error(ec)) return;
StringRef Name;
- uint64_t Offset;
+ uint64_t Address;
bool Global;
SymbolRef::Type Type;
bool Weak;
@@ -485,7 +485,7 @@ static void PrintSymbolTable(const ObjectFile *o) {
uint64_t Size;
section_iterator Section = o->end_sections();
if (error(si->getName(Name))) continue;
- if (error(si->getOffset(Offset))) continue;
+ if (error(si->getAddress(Address))) continue;
if (error(si->isGlobal(Global))) continue;
if (error(si->getType(Type))) continue;
if (error(si->isWeak(Weak))) continue;
@@ -493,8 +493,10 @@ static void PrintSymbolTable(const ObjectFile *o) {
if (error(si->getSize(Size))) continue;
if (error(si->getSection(Section))) continue;
- if (Offset == UnknownAddressOrSize)
- Offset = 0;
+ if (Address == UnknownAddressOrSize)
+ Address = 0;
+ if (Size == UnknownAddressOrSize)
+ Size = 0;
char GlobLoc = ' ';
if (Type != SymbolRef::ST_External)
GlobLoc = Global ? 'g' : 'l';
@@ -506,7 +508,7 @@ static void PrintSymbolTable(const ObjectFile *o) {
else if (Type == SymbolRef::ST_Function)
FileFunc = 'F';
- outs() << format("%08"PRIx64, Offset) << " "
+ outs() << format("%08"PRIx64, Address) << " "
<< GlobLoc // Local -> 'l', Global -> 'g', Neither -> ' '
<< (Weak ? 'w' : ' ') // Weak?
<< ' ' // Constructor. Not supported yet.