[PATCH] D133974: [objcopy] Fix order of Mach-O LINKEDIT pieces during layout

Alexander Shaposhnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 16 16:02:53 PDT 2022


alexander-shaposhnikov added a comment.

+1 to what @smeenai said



================
Comment at: llvm/lib/ObjCopy/MachO/MachOLayoutBuilder.cpp:247
+  auto linkEditUpdateOffset = [&Offset](uint32_t size) {
+    uint64_t previousOffset = Offset;
+    Offset += size;
----------------
nit: https://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly 



================
Comment at: llvm/lib/ObjCopy/MachO/MachOLayoutBuilder.cpp:276
+  uint64_t StartOfCodeSignature = Offset;
   uint32_t CodeSignatureSize = 0;
   if (O.CodeSignatureCommandIndex) {
----------------
just in case (didn't have a minute to check myself) - is uint32_t used here (and on line 246) by design ?
(arithmetic operations with Offset are done on uint64_t anyway, uint32_t will be zero-extended to uint64_t)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133974



More information about the llvm-commits mailing list