summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-objdump/MachODump.cpp
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2014-12-19 19:48:16 +0000
committerKevin Enderby <enderby@apple.com>2014-12-19 19:48:16 +0000
commit36c8d3ae63c0026b2d36a420496ab9f9f9d966a4 (patch)
treea25b5e4eaa41e58fae04e538dcc7fc2bcebd3848 /llvm/tools/llvm-objdump/MachODump.cpp
parent4aeb19893bab27da6ffc6f95a01c6a38d664dbd2 (diff)
downloadbcm5719-llvm-36c8d3ae63c0026b2d36a420496ab9f9f9d966a4.tar.gz
bcm5719-llvm-36c8d3ae63c0026b2d36a420496ab9f9f9d966a4.zip
Add printing the LC_SUB_LIBRARY load command with llvm-objdump’s -private-headers.
llvm-svn: 224607
Diffstat (limited to 'llvm/tools/llvm-objdump/MachODump.cpp')
-rw-r--r--llvm/tools/llvm-objdump/MachODump.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/tools/llvm-objdump/MachODump.cpp b/llvm/tools/llvm-objdump/MachODump.cpp
index c2a825fa8b9..577cdcdf25a 100644
--- a/llvm/tools/llvm-objdump/MachODump.cpp
+++ b/llvm/tools/llvm-objdump/MachODump.cpp
@@ -3706,6 +3706,23 @@ static void PrintSubUmbrellaCommand(MachO::sub_umbrella_command sub,
}
}
+static void PrintSubLibraryCommand(MachO::sub_library_command sub,
+ const char *Ptr) {
+ outs() << " cmd LC_SUB_LIBRARY\n";
+ outs() << " cmdsize " << sub.cmdsize;
+ if (sub.cmdsize < sizeof(struct MachO::sub_library_command))
+ outs() << " Incorrect size\n";
+ else
+ outs() << "\n";
+ if (sub.sub_library < sub.cmdsize) {
+ const char *P = Ptr + sub.sub_library;
+ outs() << " sub_library " << P << " (offset " << sub.sub_library << ")\n";
+ } else {
+ outs() << " sub_library ?(bad offset " << sub.sub_library << ")\n";
+ }
+}
+
+
static void PrintDylibCommand(MachO::dylib_command dl, const char *Ptr) {
if (dl.cmd == MachO::LC_ID_DYLIB)
outs() << " cmd LC_ID_DYLIB\n";
@@ -3868,6 +3885,9 @@ static void PrintLoadCommands(const MachOObjectFile *Obj, uint32_t ncmds,
} else if (Command.C.cmd == MachO::LC_SUB_UMBRELLA) {
MachO::sub_umbrella_command Sf = Obj->getSubUmbrellaCommand(Command);
PrintSubUmbrellaCommand(Sf, Command.Ptr);
+ } else if (Command.C.cmd == MachO::LC_SUB_LIBRARY) {
+ MachO::sub_library_command Sl = Obj->getSubLibraryCommand(Command);
+ PrintSubLibraryCommand(Sl, Command.Ptr);
} else if (Command.C.cmd == MachO::LC_LOAD_DYLIB ||
Command.C.cmd == MachO::LC_ID_DYLIB ||
Command.C.cmd == MachO::LC_LOAD_WEAK_DYLIB ||
OpenPOWER on IntegriCloud