summaryrefslogtreecommitdiff
path: root/tools
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
commitec8eac6d8b70234b2dfee623190d609e17206bca (patch)
treed3c8b0b93af86f0d3e761e7a2787b6cadb9ddf01 /tools
parent843ee2e6a46b2b2d74a84c2eea68dec35cb359cc (diff)
downloadllvm-ec8eac6d8b70234b2dfee623190d609e17206bca.tar.gz
llvm-ec8eac6d8b70234b2dfee623190d609e17206bca.tar.bz2
llvm-ec8eac6d8b70234b2dfee623190d609e17206bca.tar.xz
Do the same fix as r149667, but for the Mach-O disassembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149674 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/llvm-objdump/MachODump.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/llvm-objdump/MachODump.cpp b/tools/llvm-objdump/MachODump.cpp
index ffeea88bdc..6ea03232ed 100644
--- a/tools/llvm-objdump/MachODump.cpp
+++ b/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;