[PATCH] D120137: [lld-macho] Deduplicate CFStrings during ICF

Roger Kim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 7 13:37:00 PST 2022


Roger accepted this revision.
Roger added a comment.
This revision is now accepted and ready to land.
Herald added a project: All.

As I understand, we are zero-ing out the addends of all cfstring sections because we are moving the addend check from the section comparisons to the relocation comparisons. All relocation comparisons (not just those for cfsections) will now check addend equality. LGTM



================
Comment at: lld/MachO/ICF.cpp:119
+      else if (isa<Undefined>(sa)) // ICF runs before Undefineds are reported.
+        return false;
+      assert(isa<Defined>(sa));
----------------
For the `Undefined` case, it looks like we're making a functional change from returning `sa == sb` to always returning false. Was the previous behavior a bug? Is this `Undefined` symbol a symbol that needs to be linked to a definition in another source file?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120137



More information about the llvm-commits mailing list