[Bug 37540] Multiple games and applications wrapped with Enigma v4 and GG DRM schemes crash on startup (incompatible with use of position independent code (PIC) in Wine dlls)

wine-bugs at winehq.org wine-bugs at winehq.org
Sat Sep 1 12:21:09 CDT 2018


https://bugs.winehq.org/show_bug.cgi?id=37540

Gabriel Ivăncescu <gabrielopcode at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gabrielopcode at gmail.com

--- Comment #22 from Gabriel Ivăncescu <gabrielopcode at gmail.com> ---
Here's my take on this. 64-bit code has RIP-relative addressing. What this
means is that position-independent code comes for free and is, in fact, the
default even on Windows (mcmodel=large is much more bloated).

But that's only for 64-bit code. The thing is that -fPIC is terrible for 32-bit
code. Not only do you waste a register (and you only have half compared to
64-bit) but also to get that register you need a call and then to fetch the
return address, which is inefficient to say the least. So in fact -fno-PIC
should be the default for 32-bit code, just like on Windows.

This DRM seems to be doing this for 32-bit code to begin with. I doubt it would
assume -fno-PIC for 64-bit code since it would crash even on Windows most
likely then.

Is it not possible to simply set -fno-PIC for 32-bit Wine only, while keeping
-fPIC for 64-bit components? IMO, that would be the most correct behavior and
is very likely how Windows is compiled itself, internally.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.


More information about the wine-bugs mailing list