summaryrefslogtreecommitdiff
path: root/rts/LinkerInternals.h
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-07-14 15:54:56 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-07-16 23:50:37 -0400
commitaeb1a7c394ac78ceb4d86d1cc5805a7c2b1aa747 (patch)
treee6c4b07b520b3797d61ba58d6c58f6ec6534389c /rts/LinkerInternals.h
parenta2dc00f3b736a1128010c82ffadce96c51fbfbf4 (diff)
downloadhaskell-aeb1a7c394ac78ceb4d86d1cc5805a7c2b1aa747.tar.gz
rts/linker: Ensure that __cxa_finalize is called on code unload
Diffstat (limited to 'rts/LinkerInternals.h')
-rw-r--r--rts/LinkerInternals.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/rts/LinkerInternals.h b/rts/LinkerInternals.h
index 5370c86357..bafd7f0543 100644
--- a/rts/LinkerInternals.h
+++ b/rts/LinkerInternals.h
@@ -239,6 +239,8 @@ typedef enum {
DYNAMIC_OBJECT,
} ObjectType;
+typedef void (*cxa_finalize_fn)(void *);
+
/* Top-level structure for an object module. One of these is allocated
* for each object file in use.
*/
@@ -276,6 +278,11 @@ struct _ObjectCode {
after allocation, so that we can use realloc */
int misalignment;
+ /* The address of __cxa_finalize; set when at least one finalizer was
+ * register and therefore we must call __cxa_finalize before unloading.
+ * See Note [Resolving __dso_handle]. */
+ cxa_finalize_fn cxa_finalize;
+
/* The section-kind entries for this object module. An array. */
int n_sections;
Section* sections;