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

Owen Anderson resistor at mac.com
Mon Nov 7 09:21:37 PST 2011


Author: resistor
Date: Mon Nov  7 11:21:36 2011
New Revision: 143966

URL: http://llvm.org/viewvc/llvm-project?rev=143966&view=rev
Log:
Fix llvm-objdump's MachO mode to not depend on the value returned by RelocationRef::getInfo().

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=143966&r1=143965&r2=143966&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/MachODump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/MachODump.cpp Mon Nov  7 11:21:36 2011
@@ -385,7 +385,7 @@
     bool symbolTableWorked = false;
 
     // Parse relocations.
-    std::vector<std::pair<uint64_t, uint32_t> > Relocs;
+    std::vector<std::pair<uint64_t, SymbolRef> > Relocs;
     error_code ec;
     for (relocation_iterator RI = Sections[SectIdx].begin_relocations(),
          RE = Sections[SectIdx].end_relocations(); RI != RE; RI.increment(ec)) {
@@ -394,10 +394,10 @@
       Sections[SectIdx].getAddress(SectionAddress);
       RelocOffset -= SectionAddress;
 
-      uint64_t RelocInfo;
-      RI->getType(RelocInfo);
+      SymbolRef RelocSym;
+      RI->getSymbol(RelocSym);
 
-      Relocs.push_back(std::make_pair(RelocOffset, RelocInfo));
+      Relocs.push_back(std::make_pair(RelocOffset, RelocSym));
     }
     array_pod_sort(Relocs.begin(), Relocs.end());
 
@@ -594,8 +594,8 @@
                   Relocs[j].first < SectAddress + Inst.Address + Inst.Size) {
                 StringRef SymName;
                 uint64_t Addr;
-                UnsortedSymbols[Relocs[j].second].getName(SymName);
-                UnsortedSymbols[Relocs[j].second].getAddress(Addr);
+                Relocs[j].second.getAddress(Addr);
+                Relocs[j].second.getName(SymName);
 
                 outs() << "\t# " << SymName << ' ';
                 DumpAddress(Addr, Sections, MachOObj, outs());





More information about the llvm-commits mailing list