diff options
author | Danil Malyshev <dmalyshev@accesssoftek.com> | 2011-11-27 10:12:52 +0000 |
---|---|---|
committer | Danil Malyshev <dmalyshev@accesssoftek.com> | 2011-11-27 10:12:52 +0000 |
commit | 9b24738bd1dc791eb2c21b5562fcfe4b7b99fe2a (patch) | |
tree | 0b6229146897c4132df67e8ea79605ba3a4a0885 /tools | |
parent | 2eb5a744b18d429928751b06e205cbb88f668ae7 (diff) | |
download | external_llvm-9b24738bd1dc791eb2c21b5562fcfe4b7b99fe2a.zip external_llvm-9b24738bd1dc791eb2c21b5562fcfe4b7b99fe2a.tar.gz external_llvm-9b24738bd1dc791eb2c21b5562fcfe4b7b99fe2a.tar.bz2 |
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@145180 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/llvm-nm/llvm-nm.cpp | 2 | ||||
-rw-r--r-- | tools/llvm-objdump/MachODump.cpp | 4 | ||||
-rw-r--r-- | tools/llvm-objdump/llvm-objdump.cpp | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/tools/llvm-nm/llvm-nm.cpp b/tools/llvm-nm/llvm-nm.cpp index e79d72d..2544215 100644 --- a/tools/llvm-nm/llvm-nm.cpp +++ b/tools/llvm-nm/llvm-nm.cpp @@ -286,7 +286,7 @@ static void DumpSymbolNamesFromObject(ObjectFile *obj) { if (error(i->getSize(s.Size))) break; } if (PrintAddress) - if (error(i->getOffset(s.Address))) break; + if (error(i->getFileOffset(s.Address))) break; if (error(i->getNMTypeChar(s.TypeChar))) break; if (error(i->getName(s.Name))) break; SymbolList.push_back(s); diff --git a/tools/llvm-objdump/MachODump.cpp b/tools/llvm-objdump/MachODump.cpp index 4ccae51..ef5258d 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].getFileOffset(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].getFileOffset(NextSym); break; } ++NextSymIdx; diff --git a/tools/llvm-objdump/llvm-objdump.cpp b/tools/llvm-objdump/llvm-objdump.cpp index 9071d58..0f0ae1c 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->getFileOffset(Address))) break; StringRef Name; if (error(si->getName(Name))) break; Symbols.push_back(std::make_pair(Address, Name)); @@ -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->getFileOffset(Offset))) continue; if (error(si->isGlobal(Global))) continue; if (error(si->getType(Type))) continue; if (error(si->isWeak(Weak))) continue; |