https://bugs.winehq.org/show_bug.cgi?id=46870
--- Comment #46 from Zebediah Figura z.figura12@gmail.com --- (In reply to Olivier F. R. Dierick from comment #43)
(In reply to Zebediah Figura from comment #42)
Yes, I know, but I'm pretty sure it needs corresponding change to winegcc to actually work. Moreover, I tested myself with a PIC build, and successfully ran a custom match.
Hello,
Do you use optimization flags?
I don't, and according to comment 16 from bug 28140:
--- Quote --- the only case for '-fPIC' where a load of GOT register is emitted into prolog code is indeed "no optimization". Gcc seems to intentionally generate "bad" code here, including a redundant load of GOT register. --- Quote ---
I do (default CFLAGS="-g -O2"), but I also recall explicitly examining hex dumps for an issue related to hotpatching, and noting that GOT register load was emitted as the first instruction. It may certainly be a matter of not being used for certain functions, though. I'll try setting -O0 and see if that makes the crash appear.
(In reply to Paul Gofman from comment #45)
(In reply to Paul Gofman from comment #44)
I suppose you can do that using this patch made by Zebediah (https://www.winehq.org/pipermail/wine-devel/2018-July/128940.html) and full rebuild.
Sorry, please disregard this part, I am not sure this will work. I need to test this before suggesting.
IIRC that should work. The only reason that patch couldn't be committed is because it causes warnings for every typedef that uses __stdcall.