[PATCH] D37626: [ELF] Scan .eh_frame sections precisely in order to eliminate unused LSDAs and personality routines.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 28 16:41:05 PST 2023


MaskRay added a comment.

Can you describe the motivation of this change? It has two parts:

- Personality routine GC
- LSDA GC

Personality routine GC is typically not useful at all. (Moreover, in many configurations (without `-static-libstdc++`) personality routines are in shared objects.)

If you specify `-fbinutils-version=2.36`, `.gcc_except_table.*` sections can be GCed.

About the implementation, I think there are two issues:

- `for (EhInputSection *eh : ctx.ehInputSections) {` loop can just be executed once, not nested in a `for (;;)` loop.
- Calling `isFdeLive` twice, once in MarkLive, once in `EhFrameSection::addRecords` is not great.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D37626/new/

https://reviews.llvm.org/D37626



More information about the llvm-commits mailing list