[PATCH] D85786: [lld-macho] Emit load command LC_BUILD_VERSION

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 14:43:55 PDT 2020


int3 added a comment.

> Should I expend the effort to generalize via patterns in order to quietly absorb future load-command expansions?

The reason those tests use hardcoded offsets instead of FileCheck's numeric substitutions is because of little-endianness. I'm not sure how they can be generalized while still checking for the things we care about. (Well, this is true for local-got.s at least. relocations.s just seems to be checking the little-endian encodings of the addresses, but doesn't check that it matches the big-endian form



================
Comment at: lld/MachO/Writer.cpp:281
+
+  PlatformInfo &_platform;
+};
----------------
codebase convention is not to prefix member variables


================
Comment at: lld/test/MachO/headerpad.s:14
 # RUN: llvm-objdump --macho --all-headers %t | FileCheck %s --check-prefix=PAD0
-# PAD0:      magic        cputype  cpusubtype  caps    filetype ncmds sizeofcmds
-# PAD0-NEXT: MH_MAGIC_64  X86_64   ALL         LIB64   EXECUTE  8     [[#%u, CMDSIZE:]] {{.*}}
+# PAD0:      magic        cputype  cpusubtype  caps    filetype ncmds sizeofcmds flags
+# PAD0-NEXT: MH_MAGIC_64  X86_64   ALL         LIB64   EXECUTE  9     [[#%u, CMDSIZE:]] {{.*}}
----------------
nit: add spaces to align with column


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85786



More information about the llvm-commits mailing list