Commit f6b843cd authored by Ben Gamari's avatar Ben Gamari 🐢 Committed by Marge Bot

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.
parent d1b9d679
Pipeline #29708 canceled with stages
......@@ -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;
......
test('T12771',
[extra_files(['foo.c', 'main.hs', 'foo_dll.c']),
expect_broken(18718),
unless(opsys('mingw32'), skip)],
makefile_test, ['T12771'])
......@@ -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'])
......
test('T14611',
[extra_files(['foo.c', 'main.hs', 'foo_dll.c']),
expect_broken(18718),
unless(opsys('mingw32'), skip)],
makefile_test, ['T14611'])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment