Home | History | Annotate | Download | only in ldscripts
      1 /* Script for ld -r: link without relocation */
      2 OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64",
      3 	      "elf64-x86-64")
      4 OUTPUT_ARCH(i386:x86-64)
      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   .interp       0 : { *(.interp) }
     13   .note.gnu.build-id : { *(.note.gnu.build-id) }
     14   .hash         0 : { *(.hash) }
     15   .gnu.hash     0 : { *(.gnu.hash) }
     16   .dynsym       0 : { *(.dynsym) }
     17   .dynstr       0 : { *(.dynstr) }
     18   .gnu.version  0 : { *(.gnu.version) }
     19   .gnu.version_d 0: { *(.gnu.version_d) }
     20   .gnu.version_r 0: { *(.gnu.version_r) }
     21   .rela.init    0 : { *(.rela.init) }
     22   .rela.text    0 : { *(.rela.text) }
     23   .rela.fini    0 : { *(.rela.fini) }
     24   .rela.rodata  0 : { *(.rela.rodata) }
     25   .rela.data.rel.ro 0 : { *(.rela.data.rel.ro) }
     26   .rela.data    0 : { *(.rela.data) }
     27   .rela.tdata	0 : { *(.rela.tdata) }
     28   .rela.tbss	0 : { *(.rela.tbss) }
     29   .rela.ctors   0 : { *(.rela.ctors) }
     30   .rela.dtors   0 : { *(.rela.dtors) }
     31   .rela.got     0 : { *(.rela.got) }
     32   .rela.bss     0 : { *(.rela.bss) }
     33   .rela.ldata   0 : { *(.rela.ldata) }
     34   .rela.lbss    0 : { *(.rela.lbss) }
     35   .rela.lrodata 0 : { *(.rela.lrodata) }
     36   .rela.ifunc   0 : { *(.rela.ifunc) }
     37   .rela.plt     0 :
     38     {
     39       *(.rela.plt)
     40     }
     41   .init         0 :
     42   {
     43     KEEP (*(.init))
     44   } =0x90909090
     45   .plt          0 : { *(.plt) *(.iplt) }
     46   .text         0 :
     47   {
     48     *(.text .stub)
     49     /* .gnu.warning sections are handled specially by elf32.em.  */
     50     *(.gnu.warning)
     51   } =0x90909090
     52   .fini         0 :
     53   {
     54     KEEP (*(.fini))
     55   } =0x90909090
     56   .rodata       0 : { *(.rodata) }
     57   .rodata1      0 : { *(.rodata1) }
     58   .eh_frame_hdr : { *(.eh_frame_hdr) }
     59   .eh_frame     0 : ONLY_IF_RO { KEEP (*(.eh_frame)) }
     60   .gcc_except_table 0 : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
     61   /* Adjust the address for the data segment.  We want to adjust up to
     62      the same address within the page on the next page up.  */
     63   /* Exception handling  */
     64   .eh_frame     0 : ONLY_IF_RW { KEEP (*(.eh_frame)) }
     65   .gcc_except_table 0 : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
     66   /* Thread Local Storage sections  */
     67   .tdata	0 : { *(.tdata) }
     68   .tbss		0 : { *(.tbss) }
     69   .preinit_array   0 :
     70   {
     71     KEEP (*(.preinit_array))
     72   }
     73   .jcr          0 : { KEEP (*(.jcr)) }
     74   .dynamic      0 : { *(.dynamic) }
     75   .got          0 : { *(.got) *(.igot) }
     76   .got.plt      0 : { *(.got.plt)  *(.igot.plt) }
     77   .data         0 :
     78   {
     79     *(.data)
     80   }
     81   .data1        0 : { *(.data1) }
     82   .bss          0 :
     83   {
     84    *(.dynbss)
     85    *(.bss)
     86    *(COMMON)
     87    /* Align here to ensure that the .bss section occupies space up to
     88       _end.  Align after .bss to ensure correct alignment even if the
     89       .bss section disappears because there are no input sections.
     90       FIXME: Why do we need it? When there is no .bss section, we don't
     91       pad the .data section.  */
     92   }
     93   .lbss 0 :
     94   {
     95     *(.dynlbss)
     96     *(.lbss)
     97     *(LARGE_COMMON)
     98   }
     99   .lrodata 0  :
    100   {
    101     *(.lrodata)
    102   }
    103   .ldata 0  :
    104   {
    105     *(.ldata)
    106   }
    107   /* Stabs debugging sections.  */
    108   .stab          0 : { *(.stab) }
    109   .stabstr       0 : { *(.stabstr) }
    110   .stab.excl     0 : { *(.stab.excl) }
    111   .stab.exclstr  0 : { *(.stab.exclstr) }
    112   .stab.index    0 : { *(.stab.index) }
    113   .stab.indexstr 0 : { *(.stab.indexstr) }
    114   .comment       0 : { *(.comment) }
    115   /* DWARF debug sections.
    116      Symbols in the DWARF debugging sections are relative to the beginning
    117      of the section so we begin them at 0.  */
    118   /* DWARF 1 */
    119   .debug          0 : { *(.debug) }
    120   .line           0 : { *(.line) }
    121   /* GNU DWARF 1 extensions */
    122   .debug_srcinfo  0 : { *(.debug_srcinfo .zdebug_srcinfo) }
    123   .debug_sfnames  0 : { *(.debug_sfnames .zdebug_sfnames) }
    124   /* DWARF 1.1 and DWARF 2 */
    125   .debug_aranges  0 : { *(.debug_aranges .zdebug_aranges) }
    126   .debug_pubnames 0 : { *(.debug_pubnames .zdebug_pubnames) }
    127   /* DWARF 2 */
    128   .debug_info     0 : { *(.debug_info .zdebug_info) }
    129   .debug_abbrev   0 : { *(.debug_abbrev .zdebug_abbrev) }
    130   .debug_line     0 : { *(.debug_line .zdebug_line) }
    131   .debug_frame    0 : { *(.debug_frame .zdebug_frame) }
    132   .debug_str      0 : { *(.debug_str .zdebug_str) }
    133   .debug_loc      0 : { *(.debug_loc .zdebug_loc) }
    134   .debug_macinfo  0 : { *(.debug_macinfo .zdebug_macinfo) }
    135   /* SGI/MIPS DWARF 2 extensions */
    136   .debug_weaknames 0 : { *(.debug_weaknames .zdebug_weaknames) }
    137   .debug_funcnames 0 : { *(.debug_funcnames .zdebug_funcnames) }
    138   .debug_typenames 0 : { *(.debug_typenames .zdebug_typenames) }
    139   .debug_varnames  0 : { *(.debug_varnames .zdebug_varnames) }
    140   /* DWARF 3 */
    141   .debug_pubtypes 0 : { *(.debug_pubtypes .zdebug_pubtypes) }
    142   .debug_ranges   0 : { *(.debug_ranges .zdebug_ranges) }
    143   .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
    144 }
    145