patch applied (ghc): Stop using mremap() to allocate space for trampolines

Simon Marlow simonmarhaskell at gmail.com
Tue Sep 16 03:45:42 EDT 2008


Mon Sep 15 07:59:24 PDT 2008  Simon Marlow <marlowsd at gmail.com>
  * Stop using mremap() to allocate space for trampolines
  
  This was causing problems because sometimes mremap() moved the memory
  we had allocated from the low 2Gb to above the 2Gb boundary, causing
  some linkages to fail.  There's no MAP_32BIT flag to mremap().
  
  So now we just use mmap(MAP_ANON|MAP_32BIT) to allocated space for the
  trampolines.  People without MAP_32BIT (eg. *BSD) will still have to
  do something else here, such as allocating memory from a fixed
  address; so I've made it slightly easier for those guys, but there's
  still work to do (#2063).
  
  One solution (that Simon PJ is advocating) is to turn on -fPIC by
  default on x86-64.  This is a good solution as it removes the need for
  MAP_32BIT, but doesn't work with -fvia-C, so probably this is for
  later.

    M ./rts/Linker.c -35 +25

View patch online:
http://darcs.haskell.org/ghc/_darcs/patches/20080915145924-12142-637ca3462944bf385ca2c67424ff95dea01e729b.gz



More information about the Cvs-ghc mailing list