[PATCH] D136879: [LLD] [COFF] Include "rust_eh_personality" among the known personality functions

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 27 12:51:03 PDT 2022


mstorsjo created this revision.
mstorsjo added reviewers: rnk, mati865.
Herald added a subscriber: JDevlieghere.
Herald added a project: All.
mstorsjo requested review of this revision.
Herald added a project: LLVM.

These need to have special treatment wrt to .eh_frame sections
and GC - as long as we don't have a full parser of the .eh_frame
section in the COFF linker.

This fixes Rust unwind issues on i686 mingw as discussed in
https://github.com/msys2/MINGW-packages/issues/9091.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D136879

Files:
  lld/COFF/Driver.cpp


Index: lld/COFF/Driver.cpp
===================================================================
--- lld/COFF/Driver.cpp
+++ lld/COFF/Driver.cpp
@@ -2415,7 +2415,8 @@
       // For now, just manually try to retain the known possible personality
       // functions. This doesn't bring in more object files, but only marks
       // functions that already have been included to be retained.
-      for (const char *n : {"__gxx_personality_v0", "__gcc_personality_v0"}) {
+      for (const char *n : {"__gxx_personality_v0", "__gcc_personality_v0",
+                            "rust_eh_personality"}) {
         Defined *d = dyn_cast_or_null<Defined>(ctx.symtab.findUnderscore(n));
         if (d && !d->isGCRoot) {
           d->isGCRoot = true;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136879.471267.patch
Type: text/x-patch
Size: 744 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221027/3d3ee06c/attachment.bin>


More information about the llvm-commits mailing list