Fangrui Song ec0e556e67
[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.
2023-10-18 08:56:17 -07:00
..
2021-02-08 08:55:29 -08:00
2023-05-02 09:34:48 +08:00
2023-08-21 09:11:51 -07:00
2022-08-15 18:49:02 -04:00
2021-01-22 19:07:02 -08:00
2021-10-04 11:10:10 +01:00
2021-10-04 11:10:10 +01:00
2021-10-04 11:10:10 +01:00
2021-10-04 11:10:10 +01:00
2020-08-07 22:08:44 -07:00
2023-07-18 17:57:31 -07:00
2022-08-02 09:52:31 -04:00
2023-07-25 17:06:07 +08:00
2023-07-25 17:06:07 +08:00
2022-01-15 22:33:51 -08:00
2022-01-15 22:33:51 -08:00
2022-10-24 10:54:09 -07:00
2022-01-29 14:45:58 -08:00
2023-07-18 17:57:31 -07:00
2022-07-07 10:16:09 -07:00
2022-09-12 12:56:35 -07:00
2022-09-20 17:12:44 -07:00
2022-10-24 10:54:09 -07:00
2021-10-31 12:10:43 -07:00