Home | History | Annotate | Download | only in ldscripts
      1 /* Script for ld --shared: link shared library */
      2 OUTPUT_FORMAT("elf32-ntradbigmips", "elf32-ntradbigmips",
      3 	      "elf32-ntradlittlemips")
      4 OUTPUT_ARCH(mips)
      5 ENTRY(__start)
      6 SECTIONS
      7 {
      8   /* Read-only sections, merged into text segment: */
      9   . = 0 + SIZEOF_HEADERS;
     10   .reginfo        : { *(.reginfo) }
     11   .note.gnu.build-id : { *(.note.gnu.build-id) }
     12   .dynamic        : { *(.dynamic) }
     13   .hash           : { *(.hash) }
     14   .gnu.hash       : { *(.gnu.hash) }
     15   .dynsym         : { *(.dynsym) }
     16   .dynstr         : { *(.dynstr) }
     17   .gnu.version    : { *(.gnu.version) }
     18   .gnu.version_d  : { *(.gnu.version_d) }
     19   .gnu.version_r  : { *(.gnu.version_r) }
     20   .rel.init       : { *(.rel.init) }
     21   .rela.init      : { *(.rela.init) }
     22   .rel.text       : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
     23   .rela.text      : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
     24   .rel.fini       : { *(.rel.fini) }
     25   .rela.fini      : { *(.rela.fini) }
     26   .rel.rodata     : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
     27   .rela.rodata    : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
     28   .rel.data.rel.ro   : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
     29   .rela.data.rel.ro   : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
     30   .rel.data       : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
     31   .rela.data      : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
     32   .rel.tdata	  : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
     33   .rela.tdata	  : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
     34   .rel.tbss	  : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
     35   .rela.tbss	  : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
     36   .rel.ctors      : { *(.rel.ctors) }
     37   .rela.ctors     : { *(.rela.ctors) }
     38   .rel.dtors      : { *(.rel.dtors) }
     39   .rela.dtors     : { *(.rela.dtors) }
     40   .rel.got        : { *(.rel.got) }
     41   .rela.got       : { *(.rela.got) }
     42   .rel.dyn        : { *(.rel.dyn) }
     43   .rel.sdata      : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
     44   .rela.sdata     : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
     45   .rel.sbss       : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
     46   .rela.sbss      : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
     47   .rel.sdata2     : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
     48   .rela.sdata2    : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
     49   .rel.sbss2      : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
     50   .rela.sbss2     : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
     51   .rel.bss        : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
     52   .rela.bss       : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
     53   .rel.iplt       :
     54     {
     55       *(.rel.iplt)
     56     }
     57   .rela.iplt      :
     58     {
     59       *(.rela.iplt)
     60     }
     61   .rel.plt        :
     62     {
     63       *(.rel.plt)
     64     }
     65   .rela.plt       :
     66     {
     67       *(.rela.plt)
     68     }
     69   .init           :
     70   {
     71     KEEP (*(.init))
     72   } =0
     73   .plt            : { *(.plt) }
     74   .iplt           : { *(.iplt) }
     75   .text           :
     76   {
     77     _ftext = . ;
     78     *(.text.unlikely .text.*_unlikely)
     79     *(.text.exit .text.exit.*)
     80     *(.text.startup .text.startup.*)
     81     *(.text.hot .text.hot.*)
     82     *(.text .stub .text.* .gnu.linkonce.t.*)
     83     /* .gnu.warning sections are handled specially by elf32.em.  */
     84     *(.gnu.warning)
     85     *(.mips16.fn.*) *(.mips16.call.*)
     86   } =0
     87   .fini           :
     88   {
     89     KEEP (*(.fini))
     90   } =0
     91   PROVIDE (__etext = .);
     92   PROVIDE (_etext = .);
     93   PROVIDE (etext = .);
     94   .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
     95   .rodata1        : { *(.rodata1) }
     96   .eh_frame_hdr : { *(.eh_frame_hdr) }
     97   .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) }
     98   .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
     99   /* Adjust the address for the data segment.  We want to align at exactly
    100      a page boundary to make life easier for apriori. */
    101   . = ALIGN (CONSTANT (MAXPAGESIZE)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
    102   /* Exception handling  */
    103   .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) }
    104   .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
    105   /* Thread Local Storage sections  */
    106   .tdata	  : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
    107   .tbss		  : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
    108   /* Ensure the __preinit_array_start label is properly aligned.  We
    109      could instead move the label definition inside the section, but
    110      the linker would then create the section even if it turns out to
    111      be empty, which isn't pretty.  */
    112   . = ALIGN(32 / 8);
    113   .preinit_array     :
    114   {
    115     KEEP (*(.preinit_array))
    116   }
    117   .init_array     :
    118   {
    119     KEEP (*crtbegin*.o(.init_array))
    120     KEEP (*(SORT(.init_array.*)))
    121     KEEP (*(.init_array))
    122   }
    123   .fini_array     :
    124   {
    125     KEEP (*crtbegin*.o(.fini_array))
    126     KEEP (*(SORT(.fini_array.*)))
    127     KEEP (*(.fini_array))
    128   }
    129   .ctors          :
    130   {
    131     /* gcc uses crtbegin.o to find the start of
    132        the constructors, so we make sure it is
    133        first.  Because this is a wildcard, it
    134        doesn't matter if the user does not
    135        actually link against crtbegin.o; the
    136        linker won't look for a file to match a
    137        wildcard.  The wildcard also means that it
    138        doesn't matter which directory crtbegin.o
    139        is in.  */
    140     KEEP (*crtbegin.o(.ctors))
    141     KEEP (*crtbegin*.o(.ctors))
    142     /* We don't want to include the .ctor section from
    143        the crtend.o file until after the sorted ctors.
    144        The .ctor section from the crtend file contains the
    145        end of ctors marker and it must be last */
    146     KEEP (*(EXCLUDE_FILE (*crtend.o *crtend*.o ) .ctors))
    147     KEEP (*(SORT(.ctors.*)))
    148     KEEP (*(.ctors))
    149   }
    150   .dtors          :
    151   {
    152     KEEP (*crtbegin.o(.dtors))
    153     KEEP (*crtbegin*.o(.dtors))
    154     KEEP (*(EXCLUDE_FILE (*crtend.o *crtend*.o ) .dtors))
    155     KEEP (*(SORT(.dtors.*)))
    156     KEEP (*(.dtors))
    157   }
    158   .jcr            : { KEEP (*(.jcr)) }
    159   .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
    160   . = DATA_SEGMENT_RELRO_END (0, .);
    161   .data           :
    162   {
    163     _fdata = . ;
    164     *(.data .data.* .gnu.linkonce.d.*)
    165     SORT(CONSTRUCTORS)
    166   }
    167   .data1          : { *(.data1) }
    168   .got.plt        : { *(.got.plt) }
    169   . = .;
    170   _gp = ALIGN(16) + 0x7ff0;
    171   .got            : { *(.got) }
    172   /* We want the small data sections together, so single-instruction offsets
    173      can access them all, and initialized data all before uninitialized, so
    174      we can shorten the on-disk segment size.  */
    175   .sdata          :
    176   {
    177     *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
    178     *(.sdata .sdata.* .gnu.linkonce.s.*)
    179   }
    180   .lit8           : { *(.lit8) }
    181   .lit4           : { *(.lit4) }
    182   .srdata         : { *(.srdata) }
    183   _edata = .; PROVIDE (edata = .);
    184   __bss_start = .;
    185   _fbss = .;
    186   .sbss           :
    187   {
    188     *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
    189     *(.dynsbss)
    190     *(.sbss .sbss.* .gnu.linkonce.sb.*)
    191     *(.scommon)
    192   }
    193   .bss            :
    194   {
    195    *(.dynbss)
    196    *(.bss .bss.* .gnu.linkonce.b.*)
    197    *(COMMON)
    198    /* Align here to ensure that the .bss section occupies space up to
    199       _end.  Align after .bss to ensure correct alignment even if the
    200       .bss section disappears because there are no input sections.  */
    201    . = ALIGN(32 / 8);
    202   }
    203   . = ALIGN(32 / 8);
    204   . = ALIGN(32 / 8);
    205   _end = .;
    206   _bss_end__ = . ; __bss_end__ = . ; __end__ = . ;
    207   PROVIDE (end = .);
    208   . = DATA_SEGMENT_END (.);
    209   /* Stabs debugging sections.  */
    210   .stab          0 : { *(.stab) }
    211   .stabstr       0 : { *(.stabstr) }
    212   .stab.excl     0 : { *(.stab.excl) }
    213   .stab.exclstr  0 : { *(.stab.exclstr) }
    214   .stab.index    0 : { *(.stab.index) }
    215   .stab.indexstr 0 : { *(.stab.indexstr) }
    216   .comment       0 : { *(.comment) }
    217   /* DWARF debug sections.
    218      Symbols in the DWARF debugging sections are relative to the beginning
    219      of the section so we begin them at 0.  */
    220   /* DWARF 1 */
    221   .debug          0 : { *(.debug) }
    222   .line           0 : { *(.line) }
    223   /* GNU DWARF 1 extensions */
    224   .debug_srcinfo  0 : { *(.debug_srcinfo .zdebug_srcinfo) }
    225   .debug_sfnames  0 : { *(.debug_sfnames .zdebug_sfnames) }
    226   /* DWARF 1.1 and DWARF 2 */
    227   .debug_aranges  0 : { *(.debug_aranges .zdebug_aranges) }
    228   .debug_pubnames 0 : { *(.debug_pubnames .zdebug_pubnames) }
    229   /* DWARF 2 */
    230   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.* .zdebug_info) }
    231   .debug_abbrev   0 : { *(.debug_abbrev .zdebug_abbrev) }
    232   .debug_line     0 : { *(.debug_line .zdebug_line) }
    233   .debug_frame    0 : { *(.debug_frame .zdebug_frame) }
    234   .debug_str      0 : { *(.debug_str .zdebug_str) }
    235   .debug_loc      0 : { *(.debug_loc .zdebug_loc) }
    236   .debug_macinfo  0 : { *(.debug_macinfo .zdebug_macinfo) }
    237   /* SGI/MIPS DWARF 2 extensions */
    238   .debug_weaknames 0 : { *(.debug_weaknames .zdebug_weaknames) }
    239   .debug_funcnames 0 : { *(.debug_funcnames .zdebug_funcnames) }
    240   .debug_typenames 0 : { *(.debug_typenames .zdebug_typenames) }
    241   .debug_varnames  0 : { *(.debug_varnames .zdebug_varnames) }
    242   /* DWARF 3 */
    243   .debug_pubtypes 0 : { *(.debug_pubtypes .zdebug_pubtypes) }
    244   .debug_ranges   0 : { *(.debug_ranges .zdebug_ranges) }
    245   .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
    246   .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
    247   .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
    248   /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) *(.mdebug.*) }
    249 }
    250