summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@well-typed.com>2021-01-02 23:26:31 -0500
committerBen Gamari <ben@smart-cactus.org>2021-01-11 10:26:27 -0500
commit5370876c0021afb59b7464c3de944087b0241448 (patch)
treed1b13e33d09bbce0c6c5d557dd6ef77df6465b4a
parentb2f3a17f8f649a191040de789a985c7ff3cfef4e (diff)
downloadhaskell-5370876c0021afb59b7464c3de944087b0241448.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 10e0012e49..33eb0765a6 100644
--- a/rts/linker/PEi386.c
+++ b/rts/linker/PEi386.c
@@ -2078,7 +2078,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;