From f6b843cd44fd0170af06f52f2e1d25908184aabb Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Sat, 2 Jan 2021 23:26:31 -0500 Subject: 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. --- rts/linker/PEi386.c | 2 +- testsuite/tests/rts/T12771/all.T | 1 - testsuite/tests/rts/T13082/all.T | 1 - testsuite/tests/rts/T14611/all.T | 1 - 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/rts/linker/PEi386.c b/rts/linker/PEi386.c index 917a641310..9f13b4ce3d 100644 --- a/rts/linker/PEi386.c +++ b/rts/linker/PEi386.c @@ -2064,7 +2064,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; diff --git a/testsuite/tests/rts/T12771/all.T b/testsuite/tests/rts/T12771/all.T index 347c81b04e..55ada90cb3 100644 --- a/testsuite/tests/rts/T12771/all.T +++ b/testsuite/tests/rts/T12771/all.T @@ -1,5 +1,4 @@ test('T12771', [extra_files(['foo.c', 'main.hs', 'foo_dll.c']), - expect_broken(18718), unless(opsys('mingw32'), skip)], makefile_test, ['T12771']) diff --git a/testsuite/tests/rts/T13082/all.T b/testsuite/tests/rts/T13082/all.T index 70582b250c..8219127051 100644 --- a/testsuite/tests/rts/T13082/all.T +++ b/testsuite/tests/rts/T13082/all.T @@ -16,7 +16,6 @@ def normalise_search_dirs (str): #-------------------------------------- test('T13082_good', [extra_files(['foo.c', 'main.hs', 'foo_dll.c']), - expect_broken(18718), unless(opsys('mingw32'), skip)], makefile_test, ['T13082_good']) diff --git a/testsuite/tests/rts/T14611/all.T b/testsuite/tests/rts/T14611/all.T index 9077e0bbda..ef7873ce16 100644 --- a/testsuite/tests/rts/T14611/all.T +++ b/testsuite/tests/rts/T14611/all.T @@ -1,5 +1,4 @@ test('T14611', [extra_files(['foo.c', 'main.hs', 'foo_dll.c']), - expect_broken(18718), unless(opsys('mingw32'), skip)], makefile_test, ['T14611']) -- cgit v1.2.1