[all-commits] [llvm/llvm-project] 2e5989: [lld-macho] Flip string deduplication default

Keith Smiley via All-commits all-commits at lists.llvm.org
Thu Dec 22 15:57:07 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2e5989e8140d408cb13181430f60b6adfbf49d43
      https://github.com/llvm/llvm-project/commit/2e5989e8140d408cb13181430f60b6adfbf49d43
  Author: Keith Smiley <keithbsmiley at gmail.com>
  Date:   2022-12-22 (Thu, 22 Dec 2022)

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

  Log Message:
  -----------
  [lld-macho] Flip string deduplication default

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.

Differential Revision: https://reviews.llvm.org/D140517




More information about the All-commits mailing list