• Brendan Shanks's avatar
    loader: On Mac, reserve an area starting at 4GB to force Rosetta's allocations higher. · 307f5d00
    Brendan Shanks authored
    On Apple Silicon, Rosetta allocates memory starting at 0x100000000
    (the 4GB line) before the preloader runs.
    The .NET 3.5 installer and DirectX Jun2010 redistributable both contain
    non-relocatable EXEs with that base address, which fail to run.
    
    The workaround is to create an empty linker section at that address,
    which is mapped by the kernel before Rosetta runs and forces Rosetta's
    allocations higher in memory.
    The linker section runs from 0x100000000-0x114000000.
    Rosetta's allocations are ~132MB, and should end below 0x120000000.
    
    This is not an exact science: a non-relocatable EXE with base address
    between 0x114000000-0x120000000 will fail to run. If one is discovered,
    the section size will need to be changed.
    Signed-off-by: 's avatarBrendan Shanks <bshanks@codeweavers.com>
    Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
    307f5d00
preloader_mac.c 20.8 KB