Sebastian Lackner 0ef6e01258 loader-OSX_Preloader: Fall back to MAP_FIXED if address hint is ignored.
This should get rid of preloader warnings on old versions of macOS.
Thanks to Gijs Vermeulen for help with debugging and testing this patch.

Ideally, we would like to use vm_allocate, but since the preloader runs
very early during the startup of the process, we don't have all required
libc functions available. Also, we don't want to reimplement it ourself,
which would be very unreliable in practice.

For now, lets just use mincore() to check if there are any other pages
mapped within the area, and then fallback to MAP_FIXED.

(cherry picked from commit f254a73e6624a8603dbe310d9ee9b427145c8057)
2017-06-15 18:52:12 +02:00
..