diff options
author | Vedant Kumar <vsk@apple.com> | 2020-11-10 16:54:22 -0800 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2020-11-11 10:15:54 -0800 |
commit | d76e01a6a7c26051146fa65776cf63eb17f46fa3 (patch) | |
tree | 74350a1dd32593e5e880e4c45ce501264ca895f7 /llvm/lib/Object | |
parent | 782a93cc9abeee9bd90f7be92db4eb3895e15384 (diff) | |
download | llvm-d76e01a6a7c26051146fa65776cf63eb17f46fa3.zip llvm-d76e01a6a7c26051146fa65776cf63eb17f46fa3.tar.gz llvm-d76e01a6a7c26051146fa65776cf63eb17f46fa3.tar.bz2 |
[MachO] Allow the LC_IDENT load command
xnu coredumps include an LC_IDENT load command. It's helpful to be able
to just ignore these. IIUC an interested client can grab the identifier
using the MachOObjectFile::load_commands() API.
The status quo is that llvm bails out when it finds an LC_IDENT because
the command is obsolete (see isLoadCommandObsolete).
Differential Revision: https://reviews.llvm.org/D91221
Diffstat (limited to 'llvm/lib/Object')
-rw-r--r-- | llvm/lib/Object/MachOObjectFile.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp index 9d3c306..a10b85c 100644 --- a/llvm/lib/Object/MachOObjectFile.cpp +++ b/llvm/lib/Object/MachOObjectFile.cpp @@ -1596,6 +1596,9 @@ MachOObjectFile::MachOObjectFile(MemoryBufferRef Object, bool IsLittleEndian, if ((Err = checkTwoLevelHintsCommand(*this, Load, I, &TwoLevelHintsLoadCmd, Elements))) return; + } else if (Load.C.cmd == MachO::LC_IDENT) { + // Note: LC_IDENT is ignored. + continue; } else if (isLoadCommandObsolete(Load.C.cmd)) { Err = malformedError("load command " + Twine(I) + " for cmd value of: " + Twine(Load.C.cmd) + " is obsolete and not " |