Commit 1d012e31 authored by Simon Marlow's avatar Simon Marlow
Browse files

loadArchive: need to allocate executable memory on Win32 (#5371)

parent 63e49e13
...@@ -1997,6 +1997,11 @@ loadArchive( char *path ) ...@@ -1997,6 +1997,11 @@ loadArchive( char *path )
we could do better. */ we could do better. */
#if defined(USE_MMAP) #if defined(USE_MMAP)
image = mmapForLinker(memberSize, MAP_ANONYMOUS, -1); image = mmapForLinker(memberSize, MAP_ANONYMOUS, -1);
#elif defined(mingw32_HOST_OS)
// TODO: We would like to use allocateExec here, but allocateExec
// cannot currently allocate blocks large enough.
image = VirtualAlloc(NULL, memberSize, MEM_RESERVE | MEM_COMMIT,
PAGE_EXECUTE_READWRITE);
#elif defined(darwin_HOST_OS) #elif defined(darwin_HOST_OS)
/* See loadObj() */ /* See loadObj() */
misalignment = machoGetMisalignment(f); misalignment = machoGetMisalignment(f);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment