[llvm] Teach LLVM about filesets
authorJonas Devlieghere <jonas@devlieghere.com>
Wed, 24 Aug 2022 15:35:59 +0000 (08:35 -0700)
committerJonas Devlieghere <jonas@devlieghere.com>
Wed, 24 Aug 2022 16:33:45 +0000 (09:33 -0700)
commite854c17b02f8cd82a303d223ba5f3b0d87579cd7
tree1b56c2a19d718bfee7308115843258cb2779e9f5
parentbb63d249f8612f87e819071663d81f516a2bec74
[llvm] Teach LLVM about filesets

Teach LLVM about filesets. Filesets were added in macOS 11 (Big Sur) to
combine multiple Mach-O files. They introduce a new load command
(LC_FILESET_ENTRY) consisting of a fileset_entry_command.

  struct fileset_entry_command {
      uint32_t     cmd;        /* LC_FILESET_ENTRY */
      uint32_t     cmdsize;    /* includes entry_id string */
      uint64_t     vmaddr;     /* memory address of the entry */
      uint64_t     fileoff;    /* file offset of the entry */
      union lc_str entry_id;   /* contained entry id */
      uint32_t     reserved;   /* reserved */
  };

This patch teaches LLVM about the new load command and the corresponding
data.

Differential revision: https://reviews.llvm.org/D132432
llvm/include/llvm/BinaryFormat/MachO.def
llvm/include/llvm/BinaryFormat/MachO.h
llvm/lib/ObjectYAML/MachOYAML.cpp