[GHC] #7722: iOS patch no 11: Fix quirk with runtime loader

GHC cvs-ghc at haskell.org
Tue Feb 26 11:52:58 CET 2013


#7722: iOS patch no 11: Fix quirk with runtime loader
------------------------------+---------------------------------------------
Reporter:  StephenBlackheath  |          Owner:          
    Type:  feature request    |         Status:  new     
Priority:  normal             |      Component:  Compiler
 Version:  7.7                |       Keywords:          
      Os:  Other              |   Architecture:  arm     
 Failure:  None/Unknown       |      Blockedby:          
Blocking:                     |        Related:          
------------------------------+---------------------------------------------
 On iOS, due to a quirk, we must put references to external symbols into
 the data segment. If, for example, we have a declaration like this:

 {{{
 foreign import ccall unsafe "static stdlib.h &free"
     c_free_finalizer :: FunPtr (Ptr Word8 -> IO ())
 }}}

 ...then it tries to resolve the address of 'free' at runtime. The loader
 then attempts to write that address into the text segment. On iOS,
 modifying the text segment is not allowed, and so a runtime exception is
 thrown.

 We work around this issue by fetching the reference to the external symbol
 from the data segment.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7722>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the ghc-tickets mailing list