Add printing the LC_ENCRYPTION_INFO_64 load command with llvm-objdump’s -private-headers

and add tests for the two AArch64 binaries.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224400 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Kevin Enderby
2014-12-17 01:01:30 +00:00
parent 7c3af9120c
commit e479df2161
5 changed files with 364 additions and 2 deletions

View File

@@ -366,6 +366,8 @@ public:
getEntryPointCommand(const LoadCommandInfo &L) const;
MachO::encryption_info_command
getEncryptionInfoCommand(const LoadCommandInfo &L) const;
MachO::encryption_info_command_64
getEncryptionInfoCommand64(const LoadCommandInfo &L) const;
MachO::any_relocation_info getRelocation(DataRefImpl Rel) const;
MachO::data_in_code_entry getDice(DataRefImpl Rel) const;

View File

@@ -130,7 +130,7 @@ namespace llvm {
LC_DATA_IN_CODE = 0x00000029u,
LC_SOURCE_VERSION = 0x0000002Au,
LC_DYLIB_CODE_SIGN_DRS = 0x0000002Bu,
// 0x0000002Cu,
LC_ENCRYPTION_INFO_64 = 0x0000002Cu,
LC_LINKER_OPTIONS = 0x0000002Du,
LC_LINKER_OPTIMIZATION_HINT = 0x0000002Eu
};
@@ -842,6 +842,15 @@ namespace llvm {
uint32_t cryptid;
};
struct encryption_info_command_64 {
uint32_t cmd;
uint32_t cmdsize;
uint32_t cryptoff;
uint32_t cryptsize;
uint32_t cryptid;
uint32_t pad;
};
struct version_min_command {
uint32_t cmd; // LC_VERSION_MIN_MACOSX or
// LC_VERSION_MIN_IPHONEOS
@@ -1136,6 +1145,15 @@ namespace llvm {
sys::swapByteOrder(e.cryptid);
}
inline void swapStruct(encryption_info_command_64 &e) {
sys::swapByteOrder(e.cmd);
sys::swapByteOrder(e.cmdsize);
sys::swapByteOrder(e.cryptoff);
sys::swapByteOrder(e.cryptsize);
sys::swapByteOrder(e.cryptid);
sys::swapByteOrder(e.pad);
}
inline void swapStruct(dysymtab_command &dst) {
sys::swapByteOrder(dst.cmd);
sys::swapByteOrder(dst.cmdsize);