Daniel Thornburgh 074af0f30f
[lld][ELF] Add --why-live flag (inspired by Mach-O) (#127112)
This prints a stack of reasons that symbols that match the given glob(s)
survived GC. It has no effect unless section GC occurs.

This implementation does not require -ffunction-sections or
-fdata-sections to produce readable results, althought it does tend to
work better (as does GC).

Details about the semantics:
- Some chain of liveness reasons is reported; it isn't specified which
chain.
 - A symbol or section may be live:
   - Intrisically (e.g., entry point)
   - Because needed by a live symbol or section
   - (Symbols only) Because part of a section live for another reason
   - (Sections only) Because they contain a live symbol
 - Both global and local symbols (`STB_LOCAL`) are supported.
 - References to symbol + offset are considered to point to:
   - If the referenced symbol is a section (`STT_SECTION`):
- If a sized symbol encloses the referenced offset, the enclosing
symbol.
     - Otherwise, the section itself, generically.
   - Otherwise, the referenced symbol.
2025-03-26 09:56:33 -07:00
..
2024-10-05 09:37:27 -07:00
2024-10-06 00:31:51 -07:00
2024-11-14 22:17:10 -08:00
2024-10-10 22:22:25 -07:00
2024-09-29 14:45:00 -07:00
2025-01-03 09:38:04 -08:00
2024-09-29 15:39:52 -07:00
2024-09-29 15:32:16 -07:00
2024-10-11 23:34:43 -07:00

See docs/NewLLD.rst