Commit Graph

4 Commits

Author SHA1 Message Date
Sebastian Lackner
256e818da5 loader-OSX_Preloader: Temporarily map address ranges needed for Wine builtin DLLs.
(cherry picked from commit 463f2b02c9)
2017-06-15 05:31:20 +02:00
Sebastian Lackner
bc32032f02 loader-OSX_Preloader: Allocate pagezero for main wine binary.
This change should fix compatibility with old versions of macOS.
Thanks to Gijs Vermeulen for help with debugging and testing this patch.

Old versions of libsystem_c.dylib crash while running initializers when
the application does not contain a PAGEZERO section. This is probably
caused by an incorrect comparison against NULL instead of (void *)-1.

Unfortunately, when we just add a PAGEZERO section, we trigger the next
bug - no matter if we actually use the page at address (void *)0 or not,
it will not be used because the relocation code tries to find a memory
hole of size (highAddr - lowAddr) ~ 2GB.

We might be able to workaround this issue by manually reordering the
sections in the main executable, but for now lets just drop the fixed
image base. Please note that this introduces a risk of conflicts with
builtin DLLs, which will be resolved in the next patch.

(cherry picked from commit e9daff5bc8)
2017-06-15 05:31:05 +02:00
Sebastian Lackner
d4aa71ae9d loader-OSX_Preloader: Fix compile error with old SDK versions.
(cherry picked from commit 3fab2fbed2)
2017-06-15 05:30:13 +02:00
Sebastian Lackner
b5d451ae12 Added patch to implement preloader for Mac OS. 2017-06-12 00:50:05 +02:00