[lld] [lld][ELF] Merge equivalent symbols found during ICF (PR #139493)

Pranav Kant via llvm-commits llvm-commits at lists.llvm.org
Fri May 23 13:30:28 PDT 2025


================
@@ -286,9 +313,14 @@ bool ICF<ELFT>::constantEq(const InputSection *secA, Relocs<RelTy> ra,
     // Relocations referring to InputSections are constant-equal if their
     // section offsets are equal.
     if (isa<InputSection>(da->section)) {
-      if (da->value + addA == db->value + addB)
+      if (da->value + addA == db->value + addB) {
----------------
pranavk wrote:

The chromium build that made us revert the original change did have many sections that were being merged due to this property and @zmodem tried my second commit in this PR (https://github.com/llvm/llvm-project/pull/139493/commits/e4041b71b7c2f0abf2bc0baa926cccd0ab74bf55) separately and noticed a binary size regression that was unacceptable to them. This comment on that Chromium bug is relevant: https://b.corp.google.com/issues/415810137#comment44

https://github.com/llvm/llvm-project/pull/139493


More information about the llvm-commits mailing list