[all-commits] [llvm/llvm-project] 8389d6: [lld] Merge equivalent symbols found during ICF (#...

Pranav Kant via All-commits all-commits at lists.llvm.org
Mon Apr 21 15:17:25 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8389d6fad76bd880f02bddce7f0f2612ff0afc40
      https://github.com/llvm/llvm-project/commit/8389d6fad76bd880f02bddce7f0f2612ff0afc40
  Author: Pranav Kant <prka at google.com>
  Date:   2025-04-21 (Mon, 21 Apr 2025)

  Changed paths:
    M lld/ELF/ICF.cpp
    M lld/ELF/SymbolTable.cpp
    M lld/ELF/SymbolTable.h
    A lld/test/ELF/aarch64-got-merging-icf.s
    M lld/test/ELF/icf-preemptible.s

  Log Message:
  -----------
  [lld] Merge equivalent symbols found during ICF (#134342)

Fixes a correctness issue for AArch64 when ADRP and LDR instructions are
outlined in separate sections and sections are fed to ICF for
deduplication.

See test case (based on
https://github.com/llvm/llvm-project/issues/129122) for details. All
rodata.* sections are folded into a single section with ICF. This leads
to all f2_* function sections getting folded into one (as their
relocation target symbols g* belong to .rodata.g* sections that have
already been folded into one). Since relocations still refer original g*
symbols, we end up creating duplicate GOT entry for all such symbols.
This PR addresses that by tracking such folded symbols and create one
GOT entry for all such symbols.

Fixes https://github.com/llvm/llvm-project/issues/129122

Co-authored by: @jyknight



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list