From d76e01a6a7c26051146fa65776cf63eb17f46fa3 Mon Sep 17 00:00:00 2001 From: Vedant Kumar Date: Tue, 10 Nov 2020 16:54:22 -0800 Subject: [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 --- llvm/lib/Object/MachOObjectFile.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'llvm/lib/Object/MachOObjectFile.cpp') 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 " -- cgit v1.1