[all-commits] [llvm/llvm-project] e9262e: [ELF] SymbolTable::symbols: don't filter out Place...

Fangrui Song via All-commits all-commits at lists.llvm.org
Sun Dec 26 18:11:59 PST 2021

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e9262edf0d11a907763098d8e101219ccd9c43e9
  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/LTO.cpp
    M lld/ELF/SymbolTable.h
    M lld/ELF/Symbols.cpp

  Log Message:
  [ELF] SymbolTable::symbols: don't filter out PlaceholderKind

Placeholders (-y and redirectSymbols removed versioned symbols) are very rare and
the check just makes symbol table iteration slower. Most iterations filter out
placeholders anyway, so this change just drops the filter behavior.

For "Add symbols to symtabs", we need to ensure that redirectSymbols sets
isUsedInRegularObj to false when making a symbol placeholder, to avoid an
assertion failure in SymbolTableSection<ELFT>::writeTo.

My .text is 2KiB smaller. The speed-up linking chrome is 0.x%.

More information about the All-commits mailing list