[PATCH] D102138: [LLD] [COFF] Fix including the personality function for DWARF EH when linking with --gc-sections
Reid Kleckner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 11 11:08:53 PDT 2021
rnk added inline comments.
================
Comment at: lld/COFF/Driver.cpp:2240
+ Defined *d = dyn_cast_or_null<Defined>(
+ symtab->findUnderscore("__gxx_personality_v0"));
+ if (d && !d->isGCRoot) {
----------------
GCC produces a handful of these:
https://github.com/llvm/llvm-project/blob/main/llvm/lib/Analysis/EHPersonalities.cpp#L26
```
.Case("__gxx_personality_v0", EHPersonality::GNU_CXX)
.Case("__gxx_personality_seh0", EHPersonality::GNU_CXX)
.Case("__gxx_personality_sj0", EHPersonality::GNU_CXX_SjLj)
.Case("__gcc_personality_v0", EHPersonality::GNU_C)
.Case("__gcc_personality_seh0", EHPersonality::GNU_C)
.Case("__gcc_personality_sj0", EHPersonality::GNU_C_SjLj)
```
The `__gcc` variants mostly come from `__attribute__((cleanup))` usage, `_sj0` is presumably for sjlj eh, and I'm not sure about `_v0` vs. `_seh0`.
We could replicate the list here, or we could parse eh_frame and look for personalities. Don't we already parse eh_frame in ELF? Can we use the logic easily?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102138/new/
https://reviews.llvm.org/D102138
More information about the llvm-commits
mailing list