[commit: ghc] master: loadArchive: need to allocate executable memory on Win32 (#5371) (1d012e3)

Simon Marlow marlowsd at gmail.com
Thu Dec 1 14:03:45 CET 2011


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/1d012e31577951ff5fe74d0277fabdb08c27929d

>---------------------------------------------------------------

commit 1d012e31577951ff5fe74d0277fabdb08c27929d
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Wed Nov 30 15:34:00 2011 +0000

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

>---------------------------------------------------------------

 rts/Linker.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/rts/Linker.c b/rts/Linker.c
index 96a0741..cf2d85a 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -1997,6 +1997,11 @@ loadArchive( char *path )
                we could do better. */
 #if defined(USE_MMAP)
             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)
             /* See loadObj() */
             misalignment = machoGetMisalignment(f);





More information about the Cvs-ghc mailing list