[GHC] #5435: GHCi linker should run constructors for linked libraries

GHC ghc-devs at haskell.org
Sun Sep 15 09:45:00 CEST 2013


#5435: GHCi linker should run constructors for linked libraries
-------------------------------------+------------------------------------
        Reporter:  pumpkin           |            Owner:
            Type:  bug               |           Status:  infoneeded
        Priority:  normal            |        Milestone:  7.8.1
       Component:  Compiler          |          Version:  7.2.1
      Resolution:                    |         Keywords:
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:  3658
        Blocking:  7746, 8199        |  Related Tickets:  #3658
-------------------------------------+------------------------------------

Comment (by ezyang):

 See, what I don't understand is why the dynamic case isn't working; it
 shouldn't be exercising any of our code. OK, what happens when you run
 this set of commands?

 {{{
 ezyang at javelin:~/Dev/ghc-build-july/testsuite/tests/rts$ objdump -h
 T5435_c_dyn.o

 T5435_c_dyn.o:     file format elf64-x86-64

 Sections:
 Idx Name          Size      VMA               LMA               File off
 Algn
   0 .text         00000048  0000000000000000  0000000000000000  00000040
 2**2
                   CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
   1 .data         00000000  0000000000000000  0000000000000000  00000088
 2**2
                   CONTENTS, ALLOC, LOAD, DATA
   2 .bss          00000000  0000000000000000  0000000000000000  00000088
 2**2
                   ALLOC
   3 .rodata       00000022  0000000000000000  0000000000000000  00000088
 2**0
                   CONTENTS, ALLOC, LOAD, READONLY, DATA
   4 .init_array   00000010  0000000000000000  0000000000000000  000000b0
 2**3
                   CONTENTS, ALLOC, LOAD, RELOC, DATA
   5 .comment      0000002b  0000000000000000  0000000000000000  000000c0
 2**0
                   CONTENTS, READONLY
   6 .note.GNU-stack 00000000  0000000000000000  0000000000000000  000000eb
 2**0
                   CONTENTS, READONLY
   7 .eh_frame     00000058  0000000000000000  0000000000000000  000000f0
 2**3
                   CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
 ezyang at javelin:~/Dev/ghc-build-july/testsuite/tests/rts$ objdump -s -j
 .init_array T5435_c_dyn.o

 T5435_c_dyn.o:     file format elf64-x86-64

 Contents of section .init_array:
  0000 00000000 00000000 00000000 00000000  ................
 ezyang at javelin:~/Dev/ghc-build-july/testsuite/tests/rts$ objdump -r -j
 .init_array T5435_c_dyn.o

 T5435_c_dyn.o:     file format elf64-x86-64

 RELOCATION RECORDS FOR [.init_array]:
 OFFSET           TYPE              VALUE
 0000000000000000 R_X86_64_64       .text
 0000000000000008 R_X86_64_64       .text+0x0000000000000024



 }}}

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



More information about the ghc-tickets mailing list