diff options
author | Kevin Enderby <enderby@apple.com> | 2014-12-17 01:01:30 +0000 |
---|---|---|
committer | Kevin Enderby <enderby@apple.com> | 2014-12-17 01:01:30 +0000 |
commit | 57538299e85599efd2b4673f9fefbbf4c84a9bf9 (patch) | |
tree | 6ae752efef67251fe3fb0bd65146ff5413cdeed1 /llvm/tools/llvm-objdump/MachODump.cpp | |
parent | 8b979f01c655a694cb0ad5f58f74e21db903d27c (diff) | |
download | bcm5719-llvm-57538299e85599efd2b4673f9fefbbf4c84a9bf9.tar.gz bcm5719-llvm-57538299e85599efd2b4673f9fefbbf4c84a9bf9.zip |
Add printing the LC_ENCRYPTION_INFO_64 load command with llvm-objdump’s -private-headers
and add tests for the two AArch64 binaries.
llvm-svn: 224400
Diffstat (limited to 'llvm/tools/llvm-objdump/MachODump.cpp')
-rw-r--r-- | llvm/tools/llvm-objdump/MachODump.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/llvm/tools/llvm-objdump/MachODump.cpp b/llvm/tools/llvm-objdump/MachODump.cpp index 58c3ae70bf2..580b0368e6a 100644 --- a/llvm/tools/llvm-objdump/MachODump.cpp +++ b/llvm/tools/llvm-objdump/MachODump.cpp @@ -3558,7 +3558,7 @@ static void PrintVersionMinLoadCommand(MachO::version_min_command vd) { outs() << "." << (vd.version & 0xff); outs() << "\n"; if (vd.sdk == 0) - outs() << " sdk n/a\n"; + outs() << " sdk n/a"; else { outs() << " sdk " << ((vd.sdk >> 16) & 0xffff) << "." << ((vd.sdk >> 8) & 0xff); @@ -3622,6 +3622,28 @@ static void PrintEncryptionInfoCommand(MachO::encryption_info_command ec, outs() << " cryptid " << ec.cryptid << "\n"; } +static void PrintEncryptionInfoCommand64(MachO::encryption_info_command_64 ec, + uint32_t object_size) { + outs() << " cmd LC_ENCRYPTION_INFO_64\n"; + outs() << " cmdsize " << ec.cmdsize; + if (ec.cmdsize != sizeof(struct MachO::encryption_info_command_64)) + 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"; + outs() << " pad " << ec.pad << "\n"; +} + static void PrintDylibCommand(MachO::dylib_command dl, const char *Ptr) { if (dl.cmd == MachO::LC_ID_DYLIB) outs() << " cmd LC_ID_DYLIB\n"; @@ -3772,6 +3794,9 @@ static void PrintLoadCommands(const MachOObjectFile *Obj, uint32_t ncmds, } 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_ENCRYPTION_INFO_64) { + MachO::encryption_info_command_64 Ei = Obj->getEncryptionInfoCommand64(Command); + PrintEncryptionInfoCommand64(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 || |