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

GHC cvs-ghc at haskell.org
Tue Mar 5 10:45:00 CET 2013


#7722: iOS patch no 11: Fix quirk with runtime loader
----------------------------------+-----------------------------------------
    Reporter:  StephenBlackheath  |       Owner:              
        Type:  feature request    |      Status:  patch       
    Priority:  normal             |   Milestone:              
   Component:  Compiler           |     Version:  7.7         
    Keywords:                     |          Os:  Other       
Architecture:  arm                |     Failure:  None/Unknown
  Difficulty:  Unknown            |    Testcase:              
   Blockedby:                     |    Blocking:  7724        
     Related:                     |  
----------------------------------+-----------------------------------------
Changes (by simonmar):

 * cc: dterei (added)


Comment:

 So it looks like the C compiler is generating an indirect reference, as
 you would do when compiling a shared library (e.g. with `-fPIC`).  On ELF
 platforms it isn't necessary to do this for static object files, because
 the linker relocates the data (rather than the symbol) at runtime.  It
 looks like the iOS linker is using a different strategy.

 I expect you can fix this by telling LLVM to use a dynamic reference for
 the symbols in question (it would be any symbol which might be dynamically
 linked).  If there's no way to get LLVM to generate the right kind of
 symbol reference, then at the least you can re-use the code in GHC that
 does this: `nativeGen/PIC.hs`.

 I'm not familiar with LLVM or with GHC's LLVM backend, so I've CC'd David
 Terei who might be able to help.

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



More information about the ghc-tickets mailing list