[llvm-commits] [llvm] r149674 - /llvm/trunk/tools/llvm-objdump/MachODump.cpp

Cameron Zwarich zwarich at apple.com
Thu Feb 2 21:42:18 PST 2012


Author: zwarich
Date: Thu Feb  2 23:42:17 2012
New Revision: 149674

URL: http://llvm.org/viewvc/llvm-project?rev=149674&view=rev
Log:
Do the same fix as r149667, but for the Mach-O disassembler.

Modified:
    llvm/trunk/tools/llvm-objdump/MachODump.cpp

Modified: llvm/trunk/tools/llvm-objdump/MachODump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/MachODump.cpp?rev=149674&r1=149673&r2=149674&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/MachODump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/MachODump.cpp Thu Feb  2 23:42:17 2012
@@ -418,8 +418,11 @@
         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 @@
           Sections[SectIdx].containsSymbol(Symbols[NextSymIdx],
                                            containsNextSym);
           Symbols[NextSymIdx].getAddress(NextSym);
+          NextSym -= SectionAddress;
           break;
         }
         ++NextSymIdx;





More information about the llvm-commits mailing list