summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-objdump/MachODump.cpp
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@apple.com>2012-02-03 05:42:17 +0000
committerCameron Zwarich <zwarich@apple.com>2012-02-03 05:42:17 +0000
commit54478a514cba5472d220cf7d1334d864f562f207 (patch)
tree554a37b1d66f12622e62570da163933423eb2c53 /llvm/tools/llvm-objdump/MachODump.cpp
parent9a142cf84d9f859a7e6020fc7d99af0789751784 (diff)
downloadbcm5719-llvm-54478a514cba5472d220cf7d1334d864f562f207.tar.gz
bcm5719-llvm-54478a514cba5472d220cf7d1334d864f562f207.zip
Do the same fix as r149667, but for the Mach-O disassembler.
llvm-svn: 149674
Diffstat (limited to 'llvm/tools/llvm-objdump/MachODump.cpp')
-rw-r--r--llvm/tools/llvm-objdump/MachODump.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/tools/llvm-objdump/MachODump.cpp b/llvm/tools/llvm-objdump/MachODump.cpp
index ffeea88bdc2..6ea03232edd 100644
--- a/llvm/tools/llvm-objdump/MachODump.cpp
+++ b/llvm/tools/llvm-objdump/MachODump.cpp
@@ -418,8 +418,11 @@ void llvm::DisassembleInputMachO(StringRef Filename) {
continue;
// Start at the address of the symbol relative to the section's address.
+ uint64_t SectionAddress = 0;
uint64_t Start = 0;
+ Sections[SectIdx].getAddress(SectionAddress);
Symbols[SymIdx].getAddress(Start);
+ Start -= SectionAddress;
// Stop disassembling either at the beginning of the next symbol or at
// the end of the section.
@@ -433,6 +436,7 @@ void llvm::DisassembleInputMachO(StringRef Filename) {
Sections[SectIdx].containsSymbol(Symbols[NextSymIdx],
containsNextSym);
Symbols[NextSymIdx].getAddress(NextSym);
+ NextSym -= SectionAddress;
break;
}
++NextSymIdx;
OpenPOWER on IntegriCloud