llvm-project/lld/test
Shoaib Meenai 7cc328600e [ELF] Prevent LTO stripping of wrapped script-referenced symbols
After 1af25a9860, we stop unconditionally
retaining wrapped symbols, which means that LTO's summary-based global
dead stripping can eliminate them even if they'll be referenced by a
linker script after the wrapping is performed. Mark symbols referenced
in linker scripts as `referenced` in addition to `isUsedInRegularObj`,
so that the wrapping logic correctly sets `referencedAfterWrap` for the
symbols which will be referenced after wrapping, which will prevent LTO
from eliminating them.

An alternative would have been to change the `referencedAfterWrap` logic
to look at `isUsedInRegularObj` in addition to `referenced`, but
`isUsedInRegularObj` is also set in other places (e.g. for the entry
symbol), and it's not clear that we want `referencedAfterWrap` to take
all those places into account, so it seemed better to keep that logic
as-is and instead set `referenced` for linker script-referenced symbols.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D124433
2022-04-26 18:48:26 -07:00
..
COFF [LLD][COFF] Add support for /noimplib 2022-04-13 10:32:44 +02:00
ELF [ELF] Prevent LTO stripping of wrapped script-referenced symbols 2022-04-26 18:48:26 -07:00
MachO [lld/mac] For catalyst outputs, tolerate implicitly linking against mac-only tbd files 2022-04-23 21:43:46 -04:00
MinGW [LLD][MinGW] Add --heap argument support 2022-01-30 00:01:45 +02:00
Unit [cmake] Provide CURRENT_TOOLS_DIR centrally, replacing CLANG_TOOLS_DIR 2022-03-25 20:22:01 +01:00
wasm [lld] Remove support for legacy pass manager 2022-04-07 10:17:31 +02:00
CMakeLists.txt [cmake] Provide CURRENT_TOOLS_DIR centrally, replacing CLANG_TOOLS_DIR 2022-03-25 20:22:01 +01:00
lit.cfg.py Reland "[ELF] Enable new passmanager plugin support for LTO" 2022-03-24 16:29:18 +01:00
lit.site.cfg.py.in [cmake] Provide CURRENT_TOOLS_DIR centrally, replacing CLANG_TOOLS_DIR 2022-03-25 20:22:01 +01:00