[all-commits] [llvm/llvm-project] ec0e55: [ELF] Merge copyLocalSymbols and demoteLocalSymbol...

Fangrui Song via All-commits all-commits at lists.llvm.org
Wed Oct 18 08:56:31 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ec0e556e6708e1e979be271a74a03abd1b45496a
      https://github.com/llvm/llvm-project/commit/ec0e556e6708e1e979be271a74a03abd1b45496a
  Author: Fangrui Song <i at maskray.me>
  Date:   2023-10-18 (Wed, 18 Oct 2023)

  Changed paths:
    M lld/ELF/LinkerScript.cpp
    M lld/ELF/LinkerScript.h
    M lld/ELF/Writer.cpp
    M lld/test/ELF/gc-sections-tls.s

  Log Message:
  -----------
  [ELF] Merge copyLocalSymbols and demoteLocalSymbolsInDiscardedSections (#69425)

Follow-up to #69295: In `Writer<ELFT>::run`, the symbol passes are
flexible:
they can be placed almost everywhere before `scanRelocations`, with a
constraint
that the `computeIsPreemptible` pass must be invoked for linker-defined
non-local symbols.

Merge copyLocalSymbols and demoteLocalSymbolsInDiscardedSections to
simplify
code:

* Demoting local symbols can be made unconditional, not constrainted to
/DISCARD/ uses due to performance concerns
* `includeInSymtab` can be made faster
* Make symbol passes close to each other
* Decrease data cache misses due to saving an iteration over local
symbols

There is no speedup, likely due to the unconditional `dr->section`
access in `demoteAndCopyLocalSymbols`.

`gc-sections-tls.s` no longer reports an error because the TLS symbol is
converted to an Undefined.




More information about the All-commits mailing list