Home | History | Annotate | Download | only in ldscripts
      1 /* Script for ld -r: link without relocation */
      2 OUTPUT_FORMAT("elf64-tradbigmips", "elf64-tradbigmips",
      3 	      "elf64-tradlittlemips")
      4 OUTPUT_ARCH(mips)
      5  /* For some reason, the Solaris linker makes bad executables
      6   if gld -r is used and the intermediate file has sections starting
      7   at non-zero addresses.  Could be a Solaris ld bug, could be a GNU ld
      8   bug.  But for now assigning the zero vmas works.  */
      9 SECTIONS
     10 {
     11   /* Read-only sections, merged into text segment: */
     12   .MIPS.options : { *(.MIPS.options) }
     13   .note.gnu.build-id : { *(.note.gnu.build-id) }
     14   .dynamic      0 : { *(.dynamic) }
     15   .hash         0 : { *(.hash) }
     16   .gnu.hash     0 : { *(.gnu.hash) }
     17   .dynsym       0 : { *(.dynsym) }
     18   .dynstr       0 : { *(.dynstr) }
     19   .gnu.version  0 : { *(.gnu.version) }
     20   .gnu.version_d 0: { *(.gnu.version_d) }
     21   .gnu.version_r 0: { *(.gnu.version_r) }
     22   .rel.init     0 : { *(.rel.init) }
     23   .rela.init    0 : { *(.rela.init) }
     24   .rel.text     0 : { *(.rel.text) }
     25   .rela.text    0 : { *(.rela.text) }
     26   .rel.fini     0 : { *(.rel.fini) }
     27   .rela.fini    0 : { *(.rela.fini) }
     28   .rel.rodata   0 : { *(.rel.rodata) }
     29   .rela.rodata  0 : { *(.rela.rodata) }
     30   .rel.data.rel.ro 0 : { *(.rel.data.rel.ro) }
     31   .rela.data.rel.ro 0 : { *(.rela.data.rel.ro) }
     32   .rel.data     0 : { *(.rel.data) }
     33   .rela.data    0 : { *(.rela.data) }
     34   .rel.tdata	0 : { *(.rel.tdata) }
     35   .rela.tdata	0 : { *(.rela.tdata) }
     36   .rel.tbss	0 : { *(.rel.tbss) }
     37   .rela.tbss	0 : { *(.rela.tbss) }
     38   .rel.ctors    0 : { *(.rel.ctors) }
     39   .rela.ctors   0 : { *(.rela.ctors) }
     40   .rel.dtors    0 : { *(.rel.dtors) }
     41   .rela.dtors   0 : { *(.rela.dtors) }
     42   .rel.got      0 : { *(.rel.got) }
     43   .rela.got     0 : { *(.rela.got) }
     44   .rel.dyn      0 : { *(.rel.dyn) }
     45   .rel.sdata    0 : { *(.rel.sdata) }
     46   .rela.sdata   0 : { *(.rela.sdata) }
     47   .rel.sbss     0 : { *(.rel.sbss) }
     48   .rela.sbss    0 : { *(.rela.sbss) }
     49   .rel.sdata2   0 : { *(.rel.sdata2) }
     50   .rela.sdata2  0 : { *(.rela.sdata2) }
     51   .rel.sbss2    0 : { *(.rel.sbss2) }
     52   .rela.sbss2   0 : { *(.rela.sbss2) }
     53   .rel.bss      0 : { *(.rel.bss) }
     54   .rela.bss     0 : { *(.rela.bss) }
     55   .rel.iplt     0 :
     56     {
     57       *(.rel.iplt)
     58     }
     59   .rela.iplt    0 :
     60     {
     61       *(.rela.iplt)
     62     }
     63   .rel.plt      0 :
     64     {
     65       *(.rel.plt)
     66     }
     67   .rela.plt     0 :
     68     {
     69       *(.rela.plt)
     70     }
     71   .init         0 :
     72   {
     73     KEEP (*(SORT_NONE(.init)))
     74   }
     75   .plt          0 : { *(.plt) }
     76   .iplt         0 : { *(.iplt) }
     77   .text         0 :
     78   {
     79     *(.text .stub)
     80     /* .gnu.warning sections are handled specially by elf32.em.  */
     81     *(.gnu.warning)
     82   }
     83   .fini         0 :
     84   {
     85     KEEP (*(SORT_NONE(.fini)))
     86   }
     87   .rodata       0 : { *(.rodata) }
     88   .rodata1      0 : { *(.rodata1) }
     89   .sdata2       0 :
     90   {
     91     *(.sdata2)
     92   }
     93   .sbss2        0 : { *(.sbss2) }
     94   .eh_frame_hdr : { *(.eh_frame_hdr) }
     95   .eh_frame     0 : ONLY_IF_RO { KEEP (*(.eh_frame)) }
     96   .gcc_except_table 0 : ONLY_IF_RO { *(.gcc_except_table
     97   .gcc_except_table.*) }
     98   /* These sections are generated by the Sun/Oracle C++ compiler.  */
     99   .exception_ranges 0 : ONLY_IF_RO { *(.exception_ranges
    100   .exception_ranges*) }
    101   /* Adjust the address for the data segment.  We want to align at exactly
    102      a page boundary to make life easier for apriori. */
    103   /* Exception handling  */
    104   .eh_frame     0 : ONLY_IF_RW { KEEP (*(.eh_frame)) }
    105   .gcc_except_table 0 : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
    106   .exception_ranges 0 : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) }
    107   /* Thread Local Storage sections  */
    108   .tdata	0 : { *(.tdata) }
    109   .tbss		0 : { *(.tbss) }
    110   /* Ensure the __preinit_array_start label is properly aligned.  We
    111      could instead move the label definition inside the section, but
    112      the linker would then create the section even if it turns out to
    113      be empty, which isn't pretty.  */
    114   . = ALIGN(32 / 8);
    115   .preinit_array   0 :
    116   {
    117     KEEP (*(.preinit_array))
    118   }
    119   .jcr          0 : { KEEP (*(.jcr)) }
    120   .data         0 :
    121   {
    122     *(.data)
    123   }
    124   .data1        0 : { *(.data1) }
    125   .got.plt      0 : { *(.got.plt) }
    126   .got          0 : { *(.got) }
    127   /* We want the small data sections together, so single-instruction offsets
    128      can access them all, and initialized data all before uninitialized, so
    129      we can shorten the on-disk segment size.  */
    130   .sdata        0 :
    131   {
    132     *(.sdata)
    133   }
    134   .lit8         0 : { *(.lit8) }
    135   .lit4         0 : { *(.lit4) }
    136   .srdata       0 : { *(.srdata) }
    137   .sbss         0 :
    138   {
    139     *(.dynsbss)
    140     *(.sbss)
    141     *(.scommon)
    142   }
    143   .bss          0 :
    144   {
    145    *(.dynbss)
    146    *(.bss)
    147    *(COMMON)
    148    /* Align here to ensure that the .bss section occupies space up to
    149       _end.  Align after .bss to ensure correct alignment even if the
    150       .bss section disappears because there are no input sections.  */
    151   }
    152   /* Stabs debugging sections.  */
    153   .stab          0 : { *(.stab) }
    154   .stabstr       0 : { *(.stabstr) }
    155   .stab.excl     0 : { *(.stab.excl) }
    156   .stab.exclstr  0 : { *(.stab.exclstr) }
    157   .stab.index    0 : { *(.stab.index) }
    158   .stab.indexstr 0 : { *(.stab.indexstr) }
    159   .comment       0 : { *(.comment) }
    160   /* DWARF debug sections.
    161      Symbols in the DWARF debugging sections are relative to the beginning
    162      of the section so we begin them at 0.  */
    163   /* DWARF 1 */
    164   .debug          0 : { *(.debug) }
    165   .line           0 : { *(.line) }
    166   /* GNU DWARF 1 extensions */
    167   .debug_srcinfo  0 : { *(.debug_srcinfo) }
    168   .debug_sfnames  0 : { *(.debug_sfnames) }
    169   /* DWARF 1.1 and DWARF 2 */
    170   .debug_aranges  0 : { *(.debug_aranges) }
    171   .debug_pubnames 0 : { *(.debug_pubnames) }
    172   /* DWARF 2 */
    173   .debug_info     0 : { *(.debug_info) }
    174   .debug_abbrev   0 : { *(.debug_abbrev) }
    175   .debug_line     0 : { *(.debug_line) }
    176   .debug_frame    0 : { *(.debug_frame) }
    177   .debug_str      0 : { *(.debug_str) }
    178   .debug_loc      0 : { *(.debug_loc) }
    179   .debug_macinfo  0 : { *(.debug_macinfo) }
    180   /* SGI/MIPS DWARF 2 extensions */
    181   .debug_weaknames 0 : { *(.debug_weaknames) }
    182   .debug_funcnames 0 : { *(.debug_funcnames) }
    183   .debug_typenames 0 : { *(.debug_typenames) }
    184   .debug_varnames  0 : { *(.debug_varnames) }
    185   /* DWARF 3 */
    186   .debug_pubtypes 0 : { *(.debug_pubtypes) }
    187   .debug_ranges   0 : { *(.debug_ranges) }
    188   /* DWARF Extension.  */
    189   .debug_macro    0 : { *(.debug_macro) }
    190   .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
    191   .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
    192   .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
    193 }
    194