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

Pranav Kant via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 11 07:48:46 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:

I corrected the link in my previous comment to a public one. Apologies I didn't notice that I pasted an internal link to the Chromium bug. 

Using `da->value == db->value && addA == addB` may seem trivial but it misses cases that increases the size of chromium builds to unacceptable levels. As I mentioned in my previous comment, @zmodem had tried it already and noticed a large size regression.

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


More information about the llvm-commits mailing list