Current thunks in x64_backend.cc assumed that the calling convention is Microsoft ABI. Added an implementation for the System-V ABI which is used in Unix(-like) systems (Linux/MacOS/FreeBSD/etc).
When memory mapping a file, we should ensure it is large enough. Additionally, if "AllocFixed" is called with a nullptr base_address, the MAP_FIXED flag should not be used.
Current thunks in x64_backend.cc assumed that the calling convention is Microsoft ABI. Added an implementation for the System-V ABI which is used in Unix(-like) systems (Linux/MacOS/FreeBSD/etc).
When memory mapping a file, we should ensure it is large enough. Additionally, if "AllocFixed" is called with a nullptr base_address, the MAP_FIXED flag should not be used.
See: https://wiki.osdev.org/System_V_ABI https://man7.org/linux/man-pages/man2/mmap.2.html