[GHC] #9481: Linker does not correctly resolve symbols in previously loaded objects

GHC ghc-devs at haskell.org
Wed Aug 20 13:10:44 UTC 2014


#9481: Linker does not correctly resolve symbols in previously loaded objects
-------------------------------------+-------------------------------------
              Reporter:  edsko       |            Owner:
                  Type:  bug         |           Status:  new
              Priority:  normal      |        Milestone:
             Component:  Compiler    |          Version:  7.8.2
            Resolution:              |         Keywords:
      Operating System:              |     Architecture:  Unknown/Multiple
  Unknown/Multiple                   |       Difficulty:  Unknown
       Type of failure:              |       Blocked By:
  None/Unknown                       |  Related Tickets:
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by edsko):

 Yup, I'm on OSX. For me this gives:

 {{{
 # make
 ghc -c -O a.c
 ghc -c -O b.c
 ghc -package ghc Linkerbug
 [1 of 1] Compiling Main             ( Linkerbug.hs, Linkerbug.o )
 Linking Linkerbug ...

 # ./Linkerbug
 Loading object "b.o"
 Linkerbug:
 lookupSymbol failed in relocateSection (relocate external)
 b.o: unknown symbol `_defined_in_A'
   symbol resolution failed
 Loading object "a.o"
   symbol resolution ok
 Loading Haskell module "Main.hs"
   ok
 Running "Main.main"
 In B
 In A
 Segmentation fault: 11
 }}}

 (with GHC 7.4.2, 7.6.3, 7.8.2, 7.8.3; OSX 64 bit).

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


More information about the ghc-tickets mailing list