summaryrefslogtreecommitdiff
path: root/rts/linker
diff options
context:
space:
mode:
authorBen Gamari <ben@well-typed.com>2022-07-12 20:14:37 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-07-16 23:50:36 -0400
commit6f3816af374f5c5b70f37e14a23ca8f209c365c2 (patch)
tree0cacde1dee7ac27ab1c60064e2ae1ae0fc4edf3d /rts/linker
parent1001952f147e8837d1dea08be4cebec87592fdde (diff)
downloadhaskell-6f3816af374f5c5b70f37e14a23ca8f209c365c2.tar.gz
rts/linker/PEi386: Fix exception unwind unregistration
RtlDeleteFunctionTable expects a pointer to the .pdata section yet we passed it the .xdata section. Happily, this fixes #21354.
Diffstat (limited to 'rts/linker')
-rw-r--r--rts/linker/PEi386.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/rts/linker/PEi386.c b/rts/linker/PEi386.c
index 697768aa82..86c8cfdb03 100644
--- a/rts/linker/PEi386.c
+++ b/rts/linker/PEi386.c
@@ -532,8 +532,8 @@ void freePreloadObjectFile_PEi386(ObjectCode *oc)
if (oc->info) {
/* Release the unwinder information.
See Note [Exception Unwinding]. */
- if (oc->info->xdata) {
- if (!RtlDeleteFunctionTable (oc->info->xdata->start))
+ if (oc->info->pdata) {
+ if (!RtlDeleteFunctionTable (oc->info->pdata->start))
debugBelch ("Unable to remove Exception handlers for %" PATH_FMT "\n",
oc->fileName);
oc->info->xdata = NULL;
@@ -2105,15 +2105,16 @@ ocResolve_PEi386 ( ObjectCode* oc )
Note [Exception Unwinding]
~~~~~~~~~~~~~~~~~~~~~~~~~~
- Exception Unwinding on Windows is handle using two named sections.
+ Exception Unwinding on Windows is handled using two named sections.
.pdata: Exception registration tables.
- The .pdata section contains an array of function table entries that are used
- for exception handling. The entries must be sorted according to the
- function addresses (the first field in each structure) before being emitted
- into the final image. It is pointed to by the exception table entry in the
- image data directory. For x64 each entry contains:
+ The .pdata section contains an array of function table entries (of type
+ RUNTIME_FUNCTION) that are used for exception handling. The entries must be
+ sorted according to the function addresses (the first field in each
+ structure) before being emitted into the final image. It is pointed to by
+ the exception table entry in the image data directory. For x64 each entry
+ contains:
Offset Size Field Description
0 4 Begin Address The RVA of the corresponding function.