[GHC] #7097: linker fails to load package with binding to foreign library

GHC cvs-ghc at haskell.org
Mon Aug 6 11:58:33 CEST 2012


#7097: linker fails to load package with binding to foreign library
-------------------------------+--------------------------------------------
    Reporter:  nus             |       Owner:              
        Type:  bug             |      Status:  new         
    Priority:  normal          |   Milestone:              
   Component:  Runtime System  |     Version:  7.4.2       
    Keywords:                  |          Os:  Windows     
Architecture:  x86             |     Failure:  None/Unknown
  Difficulty:  Unknown         |    Testcase:              
   Blockedby:                  |    Blocking:              
     Related:  #2283 #3242     |  
-------------------------------+--------------------------------------------

Comment(by nus):

 Replying to [comment:10 simonmar]:
 > Could you explain what is special about the `WSACleanup` symbol here?
 Why is it different from any other symbol that we import from a DLL?
 `WSACleanup` just happens to come prior to other such symbols in the
 symbol table of the PLOF:
 {{{
 $ objdump -x network-2.3.0.14/ghc-7.4.2/HSnetwork-2.3.0.14.o |grep __imp__
 [733](sec  0)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000000
 __imp__WSACleanup at 0
 [1548](sec  0)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000000
 __imp__accept at 12
 [1787](sec  0)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000000
 __imp__inet_ntoa at 4
 [2047](sec  0)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000000
 __imp__GetLastError at 0
 [2632](sec  0)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000000
 __imp__WSAStartup at 8
 }}}
 >  After all, we call a lot of functions that live in DLLs.
 We only manage to do that for the fully linked by GNU ld executable
 images, which get loaded into the memory by the Windows dynamic loader,
 which, in turn, specially processes these 'import' symbols.

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



More information about the Glasgow-haskell-bugs mailing list