[PATCH] D121342: [lld-macho] Align cstrings less conservatively

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 9 19:59:09 PST 2022


int3 added inline comments.


================
Comment at: lld/MachO/SyntheticSections.cpp:1386-1392
+// Note that ld64's heuristic means that a dedup'ed cstring's final address is
+// dependent on the order of the input object files. E.g. if in addition to the
+// cstring at offset 18 above, we have a duplicate one in another file with a
+// `.cstring` section alignment of 2 and an offset of zero, then ld64 will pick
+// the cstring from the object file earlier on the command line (since both have
+// the same number of trailing zeros in their address). So the final cstring may
+// either be at some address `16 * k + 2` or at some address `2 * k`.
----------------
I've added this paragraph to further make the case that it's unlikely for any build to depend on this specific behavior.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121342



More information about the llvm-commits mailing list