[PATCH] D131961: [llvm-objdump] Support dumping segment information in -chained_fixups

Daniel Bertalan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 16 07:10:25 PDT 2022


BertalanD marked 2 inline comments as done.
BertalanD added inline comments.


================
Comment at: llvm/include/llvm/BinaryFormat/MachO.h:2091
+inline void swapStruct(dyld_chained_starts_in_image &C) {
+  sys::swapByteOrder(C.seg_count);
+}
----------------
thakis wrote:
> Do these have to swap the variably-sized tail too?
That's not possible because `getStructOrErr<T>` only copies `sizeof(T)` bytes of data. We manually swap the tail elements when reading them in `getChainedFixupsSegments`.


================
Comment at: llvm/lib/Object/MachOObjectFile.cpp:4780
-  // If the load command is present but the data offset has been zeroed out,
-  // as is the case for dylib stubs, return None (no error).
   uint64_t CFHeaderOffset = DyldChainedFixups.dataoff;
----------------
thakis wrote:
> keep comment?
oops, fat fingered a Command-C. fixed.


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

https://reviews.llvm.org/D131961



More information about the llvm-commits mailing list