[PATCH] D140517: [lld-macho] Flip string deduplication default

Keith Smiley via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 21 15:54:50 PST 2022


keith created this revision.
Herald added a subscriber: arphaman.
Herald added a reviewer: MaskRay.
Herald added projects: lld-macho, All.
Herald added a reviewer: lld-macho.
keith requested review of this revision.
Herald added subscribers: llvm-commits, StephenFan.
Herald added a project: LLVM.

Previously by default, when not using `--ifc=`, lld would not
deduplicate string literals. This reveals reliance on undefined behavior
where string literal addresses are compared instead of using string
equality checks. While ideally you would be able to easily identify and
eliminate the reliance on this UB, this can be difficult, especially for
third party code, and increases the friction and risk of users migrating
to lld. This flips the default to deduplicate strings unless
`--no-deduplicate-strings` is passed, matching ld64's behavior.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140517

Files:
  lld/MachO/Config.h
  lld/MachO/Driver.cpp
  lld/MachO/InputFiles.cpp
  lld/MachO/Options.td
  lld/MachO/Writer.cpp
  lld/docs/MachO/index.rst
  lld/docs/MachO/ld64-vs-lld.rst
  lld/test/MachO/cfstring-dedup.s
  lld/test/MachO/cstring-align.s
  lld/test/MachO/cstring-dedup.s
  lld/test/MachO/dead-strip.s
  lld/test/MachO/invalid/cstring-dedup.s
  lld/test/MachO/literal-dedup.s
  lld/test/MachO/map-file.s
  lld/test/MachO/objc-methname.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140517.484709.patch
Type: text/x-patch
Size: 19225 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221221/fd9adf65/attachment-0001.bin>


More information about the llvm-commits mailing list