[PATCH] D12496: [llvm-readobj] Dump MachO Dysymtab command
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 31 12:33:46 PDT 2015
This revision was automatically updated to reflect the committed changes.
Closed by commit rL246474: [llvm-readobj] Dump MachO Dysymtab command. (authored by davide).
Changed prior to commit:
http://reviews.llvm.org/D12496?vs=33595&id=33612#toc
Repository:
rL LLVM
http://reviews.llvm.org/D12496
Files:
llvm/trunk/tools/llvm-readobj/MachODumper.cpp
llvm/trunk/tools/llvm-readobj/ObjDumper.h
llvm/trunk/tools/llvm-readobj/llvm-readobj.cpp
Index: llvm/trunk/tools/llvm-readobj/MachODumper.cpp
===================================================================
--- llvm/trunk/tools/llvm-readobj/MachODumper.cpp
+++ llvm/trunk/tools/llvm-readobj/MachODumper.cpp
@@ -43,6 +43,7 @@
// MachO-specific.
void printMachODataInCode() override;
void printMachOVersionMin() override;
+ void printMachODysymtab() override;
private:
template<class MachHeader>
@@ -663,3 +664,30 @@
}
}
}
+
+void MachODumper::printMachODysymtab() {
+ for (const auto &Load : Obj->load_commands()) {
+ if (Load.C.cmd == MachO::LC_DYSYMTAB) {
+ MachO::dysymtab_command DLC = Obj->getDysymtabLoadCommand();
+ DictScope Group(W, "Dysymtab");
+ W.printNumber("ilocalsym", DLC.ilocalsym);
+ W.printNumber("nlocalsym", DLC.nlocalsym);
+ W.printNumber("iextdefsym", DLC.iextdefsym);
+ W.printNumber("nextdefsym", DLC.nextdefsym);
+ W.printNumber("iundefsym", DLC.iundefsym);
+ W.printNumber("nundefsym", DLC.nundefsym);
+ W.printNumber("tocoff", DLC.tocoff);
+ W.printNumber("ntoc", DLC.ntoc);
+ W.printNumber("modtaboff", DLC.modtaboff);
+ W.printNumber("nmodtab", DLC.nmodtab);
+ W.printNumber("extrefsymoff", DLC.extrefsymoff);
+ W.printNumber("nextrefsyms", DLC.nextrefsyms);
+ W.printNumber("indirectsymoff", DLC.indirectsymoff);
+ W.printNumber("nindirectsyms", DLC.nindirectsyms);
+ W.printNumber("extreloff", DLC.extreloff);
+ W.printNumber("nextrel", DLC.nextrel);
+ W.printNumber("locreloff", DLC.locreloff);
+ W.printNumber("nlocrel", DLC.nlocrel);
+ }
+ }
+}
Index: llvm/trunk/tools/llvm-readobj/ObjDumper.h
===================================================================
--- llvm/trunk/tools/llvm-readobj/ObjDumper.h
+++ llvm/trunk/tools/llvm-readobj/ObjDumper.h
@@ -58,6 +58,7 @@
// Only implemented for MachO.
virtual void printMachODataInCode() { }
virtual void printMachOVersionMin() { }
+ virtual void printMachODysymtab() { }
virtual void printStackMap() const = 0;
Index: llvm/trunk/tools/llvm-readobj/llvm-readobj.cpp
===================================================================
--- llvm/trunk/tools/llvm-readobj/llvm-readobj.cpp
+++ llvm/trunk/tools/llvm-readobj/llvm-readobj.cpp
@@ -191,6 +191,12 @@
cl::opt<bool>
MachOVersionMin("macho-version-min",
cl::desc("Display MachO version min command"));
+
+ // -macho-dysymtab
+ cl::opt<bool>
+ MachODysymtab("macho-dysymtab",
+ cl::desc("Display MachO Dysymtab command"));
+
// -stackmap
cl::opt<bool>
PrintStackMap("stackmap",
@@ -327,6 +333,8 @@
Dumper->printMachODataInCode();
if (opts::MachOVersionMin)
Dumper->printMachOVersionMin();
+ if (opts::MachODysymtab)
+ Dumper->printMachODysymtab();
}
if (opts::PrintStackMap)
Dumper->printStackMap();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12496.33612.patch
Type: text/x-patch
Size: 2894 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150831/0d4a14c6/attachment.bin>
More information about the llvm-commits
mailing list