[PATCH] D132432: [llvm] Teach LLVM about filesets

Jonas Devlieghere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 24 09:33:58 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGe854c17b02f8: [llvm] Teach LLVM about filesets (authored by JDevlieghere).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132432/new/

https://reviews.llvm.org/D132432

Files:
  llvm/include/llvm/BinaryFormat/MachO.def
  llvm/include/llvm/BinaryFormat/MachO.h
  llvm/lib/ObjectYAML/MachOYAML.cpp


Index: llvm/lib/ObjectYAML/MachOYAML.cpp
===================================================================
--- llvm/lib/ObjectYAML/MachOYAML.cpp
+++ llvm/lib/ObjectYAML/MachOYAML.cpp
@@ -613,6 +613,13 @@
   IO.mapRequired("ntools", LoadCommand.ntools);
 }
 
+void MappingTraits<MachO::fileset_entry_command>::mapping(
+    IO &IO, MachO::fileset_entry_command &LoadCommand) {
+  IO.mapRequired("vmaddr", LoadCommand.vmaddr);
+  IO.mapRequired("fileoff", LoadCommand.fileoff);
+  IO.mapRequired("id", LoadCommand.entry_id);
+}
+
 } // end namespace yaml
 
 } // end namespace llvm
Index: llvm/include/llvm/BinaryFormat/MachO.h
===================================================================
--- llvm/include/llvm/BinaryFormat/MachO.h
+++ llvm/include/llvm/BinaryFormat/MachO.h
@@ -50,7 +50,8 @@
   MH_BUNDLE = 0x8u,
   MH_DYLIB_STUB = 0x9u,
   MH_DSYM = 0xAu,
-  MH_KEXT_BUNDLE = 0xBu
+  MH_KEXT_BUNDLE = 0xBu,
+  MH_FILESET = 0xCu,
 };
 
 enum {
@@ -885,6 +886,14 @@
   uint32_t count;
 };
 
+struct fileset_entry_command {
+  uint32_t cmd;
+  uint32_t cmdsize;
+  uint64_t vmaddr;
+  uint64_t fileoff;
+  uint32_t entry_id;
+};
+
 // The symseg_command is obsolete and no longer supported.
 struct symseg_command {
   uint32_t cmd;
@@ -1363,6 +1372,14 @@
   sys::swapByteOrder(C.count);
 }
 
+inline void swapStruct(fileset_entry_command &C) {
+  sys::swapByteOrder(C.cmd);
+  sys::swapByteOrder(C.cmdsize);
+  sys::swapByteOrder(C.vmaddr);
+  sys::swapByteOrder(C.fileoff);
+  sys::swapByteOrder(C.entry_id);
+}
+
 inline void swapStruct(version_min_command &C) {
   sys::swapByteOrder(C.cmd);
   sys::swapByteOrder(C.cmdsize);
Index: llvm/include/llvm/BinaryFormat/MachO.def
===================================================================
--- llvm/include/llvm/BinaryFormat/MachO.def
+++ llvm/include/llvm/BinaryFormat/MachO.def
@@ -76,6 +76,7 @@
 HANDLE_LOAD_COMMAND(LC_BUILD_VERSION, 0x00000032u, build_version_command)
 HANDLE_LOAD_COMMAND(LC_DYLD_EXPORTS_TRIE, 0x80000033u, linkedit_data_command)
 HANDLE_LOAD_COMMAND(LC_DYLD_CHAINED_FIXUPS, 0x80000034u, linkedit_data_command)
+HANDLE_LOAD_COMMAND(LC_FILESET_ENTRY, 0x80000035u, fileset_entry_command)
 
 #endif
 
@@ -114,6 +115,7 @@
 LOAD_COMMAND_STRUCT(version_min_command)
 LOAD_COMMAND_STRUCT(note_command)
 LOAD_COMMAND_STRUCT(build_version_command)
+LOAD_COMMAND_STRUCT(fileset_entry_command)
 
 #endif
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132432.455252.patch
Type: text/x-patch
Size: 2379 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220824/eb6dbbfd/attachment.bin>


More information about the llvm-commits mailing list