[all-commits] [llvm/llvm-project] 7924b3: [ELF] Add Symbol::hasVersionSuffix

Fangrui Song via All-commits all-commits at lists.llvm.org
Sun Dec 26 17:26:07 PST 2021

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7924b3814f40747cafff7aec24e6b16fda02af44
  Author: Fangrui Song <i at maskray.me>
  Date:   2021-12-26 (Sun, 26 Dec 2021)

  Changed paths:
    M lld/ELF/Driver.cpp
    M lld/ELF/Relocations.cpp
    M lld/ELF/SymbolTable.cpp
    M lld/ELF/Symbols.cpp
    M lld/ELF/Symbols.h
    M lld/test/ELF/empty-ver2.s

  Log Message:
  [ELF] Add Symbol::hasVersionSuffix

"Process symbol versions" may take 2+% time.
"Redirect symbols" may take 0.6% time.
This change speeds up the two passes and makes `*sym.getVersionSuffix()
== '@'` in the `undefined reference` diagnostic cleaner.

Linking chrome (no debug info) and another large program is 1.5% faster.

For empty-ver2.s: the behavior now matches GNU ld, though I'd consider the input
invalid and the exact behavior does not matter.

More information about the All-commits mailing list