summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@well-typed.com>2021-01-02 23:26:31 -0500
committerBen Gamari <ben@well-typed.com>2021-01-06 13:39:52 -0500
commit441bb6852eba98ad4376a6f44f9fca66e3ec5fad (patch)
treeed5b8801fa9b0f4ab6fc0fbb32b0c9d7c987b321
parent3e68f65645651313e9d31186af3fb48dc5f1de73 (diff)
downloadhaskell-441bb6852eba98ad4376a6f44f9fca66e3ec5fad.tar.gz
rts/PEi386: Fix reentrant lock usage
Previously lookupSymbol_PEi386 would call lookupSymbol while holding linker_mutex. Fix this by rather calling `lookupDependentSymbol`. This is safe because lookupSymbol_PEi386 unconditionally holds linker_mutex. Happily, this un-breaks `T12771`, `T13082_good`, and `T14611`, which were previously marked as broken due to #18718. Closes #19155. (cherry picked from commit a7105e53921e715d4d70c7c45ddc79bdc6eebffc)
-rw-r--r--rts/linker/PEi386.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rts/linker/PEi386.c b/rts/linker/PEi386.c
index fb1811308f..80a8ec78ff 100644
--- a/rts/linker/PEi386.c
+++ b/rts/linker/PEi386.c
@@ -2079,7 +2079,7 @@ SymbolAddr *lookupSymbol_PEi386(SymbolName *lbl)
else if (pinfo && pinfo->owner && isSymbolImport (pinfo->owner, lbl))
{
/* See Note [BFD import library]. */
- HINSTANCE dllInstance = (HINSTANCE)lookupSymbol(pinfo->value);
+ HINSTANCE dllInstance = (HINSTANCE)lookupDependentSymbol(pinfo->value, NULL);
if (!dllInstance && pinfo->value)
return pinfo->value;