diff options
| author | Kevin Enderby <enderby@apple.com> | 2014-12-16 23:25:52 +0000 |
|---|---|---|
| committer | Kevin Enderby <enderby@apple.com> | 2014-12-16 23:25:52 +0000 |
| commit | 0804f467f290ee479ec4ebf4b675880e46b9dfae (patch) | |
| tree | 5281f661786613c2f09804f943a9248fecfd01d2 /llvm/tools/llvm-objdump | |
| parent | 875902689353d92ee3ff49fccb3412b2656176c7 (diff) | |
| download | bcm5719-llvm-0804f467f290ee479ec4ebf4b675880e46b9dfae.tar.gz bcm5719-llvm-0804f467f290ee479ec4ebf4b675880e46b9dfae.zip | |
Add printing the LC_ENCRYPTION_INFO load command with llvm-objdump’s -private-headers.
llvm-svn: 224390
Diffstat (limited to 'llvm/tools/llvm-objdump')
| -rw-r--r-- | llvm/tools/llvm-objdump/MachODump.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/tools/llvm-objdump/MachODump.cpp b/llvm/tools/llvm-objdump/MachODump.cpp index 454d3d15771..58c3ae70bf2 100644 --- a/llvm/tools/llvm-objdump/MachODump.cpp +++ b/llvm/tools/llvm-objdump/MachODump.cpp @@ -3601,6 +3601,27 @@ static void PrintEntryPointCommand(MachO::entry_point_command ep) { outs() << " stacksize " << ep.stacksize << "\n"; } +static void PrintEncryptionInfoCommand(MachO::encryption_info_command ec, + uint32_t object_size) { + outs() << " cmd LC_ENCRYPTION_INFO\n"; + outs() << " cmdsize " << ec.cmdsize; + if (ec.cmdsize != sizeof(struct MachO::encryption_info_command)) + outs() << " Incorrect size\n"; + else + outs() << "\n"; + outs() << " cryptoff " << ec.cryptoff; + if (ec.cryptoff > object_size) + outs() << " (past end of file)\n"; + else + outs() << "\n"; + outs() << " cryptsize " << ec.cryptsize; + if (ec.cryptsize > object_size) + outs() << " (past end of file)\n"; + else + outs() << "\n"; + outs() << " cryptid " << ec.cryptid << "\n"; +} + static void PrintDylibCommand(MachO::dylib_command dl, const char *Ptr) { if (dl.cmd == MachO::LC_ID_DYLIB) outs() << " cmd LC_ID_DYLIB\n"; @@ -3748,6 +3769,9 @@ static void PrintLoadCommands(const MachOObjectFile *Obj, uint32_t ncmds, } else if (Command.C.cmd == MachO::LC_MAIN) { MachO::entry_point_command Ep = Obj->getEntryPointCommand(Command); PrintEntryPointCommand(Ep); + } else if (Command.C.cmd == MachO::LC_ENCRYPTION_INFO) { + MachO::encryption_info_command Ei = Obj->getEncryptionInfoCommand(Command); + PrintEncryptionInfoCommand(Ei, Buf.size()); } else if (Command.C.cmd == MachO::LC_LOAD_DYLIB || Command.C.cmd == MachO::LC_ID_DYLIB || Command.C.cmd == MachO::LC_LOAD_WEAK_DYLIB || |

