summaryrefslogtreecommitdiff
path: root/rts/linker/PEi386.c
diff options
context:
space:
mode:
Diffstat (limited to 'rts/linker/PEi386.c')
-rw-r--r--rts/linker/PEi386.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/rts/linker/PEi386.c b/rts/linker/PEi386.c
index 33eb0765a6..ec9d5c9080 100644
--- a/rts/linker/PEi386.c
+++ b/rts/linker/PEi386.c
@@ -327,6 +327,11 @@ void initLinker_PEi386()
HeapSetInformation(code_heap, HeapEnableTerminationOnCorruption,
&HeapInformation, sizeof(HeapInformation));
HeapSetInformation(code_heap, HeapOptimizeResources, NULL, 0);
+
+ /* Register the cleanup routine as an exit handler, this gives other exit handlers
+ a chance to run which may need linker information. Exit handlers are ran in
+ reverse registration order so this needs to be before the linker loads anything. */
+ atexit (exitLinker_PEi386);
}
void exitLinker_PEi386()