llvm-project
1869b15a - [ELF] --why-live: Skip symbol at index 0 and section symbols, handle .eh_frame symbols (#177099)

Commit
47 days ago
[ELF] --why-live: Skip symbol at index 0 and section symbols, handle .eh_frame symbols (#177099) Symbols of empty names can be matched by `--why-live='*'`, which are generally not useful. * The first entry in a symbol table (STB_LOCAL and undefined) * `STT_SECTION` symbols (emitted by LLVM integrated assembler when needed by relocations). These input section symbols will be demoted by `demoteAndCopyLocalSymbols`, so technically not really live. In addition, such symbols of non-allocable sections currently lead to crashes: `whyLive` does not record the section, causing the second iteration of the `while (true)` loop in printWhyLive to call `std::get<Symbol *>(cur)` when `cur` is an `InputSectionBase *`. In addition, handle GCC crtendS.o `__FRAME_END__`, which is defined relative to a `.eh_frame` section created with `__attribute__((used, section(".eh_frame")))`. Fix #176890
Author
Parents
Loading