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

GHC ghc-devs at haskell.org
Sun Sep 15 17:33:42 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 simonmar):

 I have .ctors:

 {{{
 > objdump --all-headers T5435_c_dyn.o

 T5435_c_dyn.o:     file format elf64-x86-64
 T5435_c_dyn.o
 architecture: i386:x86-64, flags 0x00000011:
 HAS_RELOC, HAS_SYMS
 start address 0x0000000000000000

 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 .ctors        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
 SYMBOL TABLE:
 0000000000000000 l    df *ABS*  0000000000000000 T5435.c
 0000000000000000 l    d  .text  0000000000000000 .text
 0000000000000000 l    d  .data  0000000000000000 .data
 0000000000000000 l    d  .bss   0000000000000000 .bss
 0000000000000000 l    d  .rodata        0000000000000000 .rodata
 0000000000000000 l     F .text  0000000000000024 initializer1
 0000000000000000 l    d  .ctors 0000000000000000 .ctors
 0000000000000024 l     F .text  0000000000000024 initializer2
 0000000000000000 l    d  .note.GNU-stack        0000000000000000 .note
 .GNU-stack
 0000000000000000 l    d  .eh_frame      0000000000000000 .eh_frame
 0000000000000000 l    d  .comment       0000000000000000 .comment
 0000000000000000         *UND*  0000000000000000 _GLOBAL_OFFSET_TABLE_
 0000000000000000         *UND*  0000000000000000 puts
 0000000000000000         *UND*  0000000000000000 stdout
 0000000000000000         *UND*  0000000000000000 fflush


 RELOCATION RECORDS FOR [.text]:
 OFFSET           TYPE              VALUE
 0000000000000007 R_X86_64_PC32     .rodata-0x0000000000000004
 000000000000000c R_X86_64_PLT32    puts-0x0000000000000004
 0000000000000013 R_X86_64_GOTPCREL  stdout-0x0000000000000004
 000000000000001e R_X86_64_PLT32    fflush-0x0000000000000004
 000000000000002b R_X86_64_PC32     .rodata+0x000000000000000d
 0000000000000030 R_X86_64_PLT32    puts-0x0000000000000004
 0000000000000037 R_X86_64_GOTPCREL  stdout-0x0000000000000004
 0000000000000042 R_X86_64_PLT32    fflush-0x0000000000000004


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


 RELOCATION RECORDS FOR [.eh_frame]:
 OFFSET           TYPE              VALUE
 0000000000000020 R_X86_64_PC32     .text
 0000000000000040 R_X86_64_PC32     .text+0x0000000000000024

 }}}

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



More information about the ghc-tickets mailing list