Comment

Comment by jchw

This is useful information, and I think it explains exactly how we wound up with pseudo relocs instead of thunks, but honestly, the thing that makes this so bothersome is that there's really no documentation that explains this, there's seemingly no warning when it occurs, and there's no error when it fails.

From my perspective, I saw WINE crashing with a CALL into seemingly nowhere. Then I realized the CALL on disk pointed directly to the IAT (which obviously makes no sense.) Finally I realized that the library probably shouldn't be linking to VirtualProtect, traced it to the entrypoint, and found an error message that made me aware of the existence of pseudo relocs.

There was a 0% chance the person who created this bug was ever going to figure it out, and I'm not even sure I could've figured out the build issue if I had access to the project files. There's plenty of minutiae when it comes to MinGW and MSys and a lot of people are not adequately prepared for what they are getting themselves into. I think (hope) the mess with exception handling is cleared up and everyone just uses SEH on Windows, but I bet there's still issues with licensing and winpthreads, and MSys and PTYs.

I'd be more than happy to try to submit PRs to help with this particular problem, though I'm not going to lie, I find the pseudo-reloc thing horrifying and would be afraid of somehow breaking some ridiculous edge case.

parent jchw 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton