Home | History | Annotate | Download | only in ldscripts
      1 /* Script for ld --shared: link shared library */
      2 OUTPUT_FORMAT("elf64-l1om", "elf64-l1om",
      3 	      "elf64-l1om")
      4 OUTPUT_ARCH(l1om)
      5 ENTRY(_start)
      6 SECTIONS
      7 {
      8   /* Read-only sections, merged into text segment: */
      9   . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
     10   .note.gnu.build-id : { *(.note.gnu.build-id) }
     11   .hash           : { *(.hash) }
     12   .gnu.hash       : { *(.gnu.hash) }
     13   .dynsym         : { *(.dynsym) }
     14   .dynstr         : { *(.dynstr) }
     15   .gnu.version    : { *(.gnu.version) }
     16   .gnu.version_d  : { *(.gnu.version_d) }
     17   .gnu.version_r  : { *(.gnu.version_r) }
     18   .rela.init      : { *(.rela.init) }
     19   .rela.text      : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
     20   .rela.fini      : { *(.rela.fini) }
     21   .rela.rodata    : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
     22   .rela.data.rel.ro   : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
     23   .rela.data      : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
     24   .rela.tdata	  : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
     25   .rela.tbss	  : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
     26   .rela.ctors     : { *(.rela.ctors) }
     27   .rela.dtors     : { *(.rela.dtors) }
     28   .rela.got       : { *(.rela.got) }
     29   .rela.bss       : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
     30   .rela.ldata     : { *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*) }
     31   .rela.lbss      : { *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*) }
     32   .rela.lrodata   : { *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*) }
     33   .rela.iplt      :
     34     {
     35       *(.rela.iplt)
     36     }
     37   .rela.plt       :
     38     {
     39       *(.rela.plt)
     40     }
     41   .init           :
     42   {
     43     KEEP (*(.init))
     44   } =0x90909090
     45   .plt            : { *(.plt) }
     46   .iplt           : { *(.iplt) }
     47   .text           :
     48   {
     49     *(.text.unlikely .text.*_unlikely)
     50     *(.text.exit .text.exit.*)
     51     *(.text.startup .text.startup.*)
     52     *(.text.hot .text.hot.*)
     53     *(.text .stub .text.* .gnu.linkonce.t.*)
     54     /* .gnu.warning sections are handled specially by elf32.em.  */
     55     *(.gnu.warning)
     56   } =0x90909090
     57   .fini           :
     58   {
     59     KEEP (*(.fini))
     60   } =0x90909090
     61   PROVIDE (__etext = .);
     62   PROVIDE (_etext = .);
     63   PROVIDE (etext = .);
     64   .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
     65   .rodata1        : { *(.rodata1) }
     66   .eh_frame_hdr : { *(.eh_frame_hdr) }
     67   .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) }
     68   .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
     69   /* Adjust the address for the data segment.  We want to adjust up to
     70      the same address within the page on the next page up.  */
     71   . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
     72   /* Exception handling  */
     73   .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) }
     74   .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
     75   /* Thread Local Storage sections  */
     76   .tdata	  : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
     77   .tbss		  : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
     78   .preinit_array     :
     79   {
     80     KEEP (*(.preinit_array))
     81   }
     82   .init_array     :
     83   {
     84     KEEP (*(SORT(.init_array.*)))
     85     KEEP (*(.init_array))
     86   }
     87   .fini_array     :
     88   {
     89     KEEP (*(SORT(.fini_array.*)))
     90     KEEP (*(.fini_array))
     91   }
     92   .ctors          :
     93   {
     94     /* gcc uses crtbegin.o to find the start of
     95        the constructors, so we make sure it is
     96        first.  Because this is a wildcard, it
     97        doesn't matter if the user does not
     98        actually link against crtbegin.o; the
     99        linker won't look for a file to match a
    100        wildcard.  The wildcard also means that it
    101        doesn't matter which directory crtbegin.o
    102        is in.  */
    103     KEEP (*crtbegin.o(.ctors))
    104     KEEP (*crtbegin?.o(.ctors))
    105     /* We don't want to include the .ctor section from
    106        the crtend.o file until after the sorted ctors.
    107        The .ctor section from the crtend file contains the
    108        end of ctors marker and it must be last */
    109     KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
    110     KEEP (*(SORT(.ctors.*)))
    111     KEEP (*(.ctors))
    112   }
    113   .dtors          :
    114   {
    115     KEEP (*crtbegin.o(.dtors))
    116     KEEP (*crtbegin?.o(.dtors))
    117     KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
    118     KEEP (*(SORT(.dtors.*)))
    119     KEEP (*(.dtors))
    120   }
    121   .jcr            : { KEEP (*(.jcr)) }
    122   .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
    123   .dynamic        : { *(.dynamic) }
    124   .got            : { *(.got) *(.igot) }
    125   . = DATA_SEGMENT_RELRO_END (24, .);
    126   .got.plt        : { *(.got.plt)  *(.igot.plt) }
    127   .data           :
    128   {
    129     *(.data .data.* .gnu.linkonce.d.*)
    130     SORT(CONSTRUCTORS)
    131   }
    132   .data1          : { *(.data1) }
    133   _edata = .; PROVIDE (edata = .);
    134   __bss_start = .;
    135   .bss            :
    136   {
    137    *(.dynbss)
    138    *(.bss .bss.* .gnu.linkonce.b.*)
    139    *(COMMON)
    140    /* Align here to ensure that the .bss section occupies space up to
    141       _end.  Align after .bss to ensure correct alignment even if the
    142       .bss section disappears because there are no input sections.
    143       FIXME: Why do we need it? When there is no .bss section, we don't
    144       pad the .data section.  */
    145    . = ALIGN(. != 0 ? 64 / 8 : 1);
    146   }
    147   .lbss   :
    148   {
    149     *(.dynlbss)
    150     *(.lbss .lbss.* .gnu.linkonce.lb.*)
    151     *(LARGE_COMMON)
    152   }
    153   . = ALIGN(64 / 8);
    154   .lrodata   ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) :
    155   {
    156     *(.lrodata .lrodata.* .gnu.linkonce.lr.*)
    157   }
    158   .ldata   ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) :
    159   {
    160     *(.ldata .ldata.* .gnu.linkonce.l.*)
    161     . = ALIGN(. != 0 ? 64 / 8 : 1);
    162   }
    163   . = ALIGN(64 / 8);
    164   _end = .; PROVIDE (end = .);
    165   . = DATA_SEGMENT_END (.);
    166   /* Stabs debugging sections.  */
    167   .stab          0 : { *(.stab) }
    168   .stabstr       0 : { *(.stabstr) }
    169   .stab.excl     0 : { *(.stab.excl) }
    170   .stab.exclstr  0 : { *(.stab.exclstr) }
    171   .stab.index    0 : { *(.stab.index) }
    172   .stab.indexstr 0 : { *(.stab.indexstr) }
    173   .comment       0 : { *(.comment) }
    174   /* DWARF debug sections.
    175      Symbols in the DWARF debugging sections are relative to the beginning
    176      of the section so we begin them at 0.  */
    177   /* DWARF 1 */
    178   .debug          0 : { *(.debug) }
    179   .line           0 : { *(.line) }
    180   /* GNU DWARF 1 extensions */
    181   .debug_srcinfo  0 : { *(.debug_srcinfo .zdebug_srcinfo) }
    182   .debug_sfnames  0 : { *(.debug_sfnames .zdebug_sfnames) }
    183   /* DWARF 1.1 and DWARF 2 */
    184   .debug_aranges  0 : { *(.debug_aranges .zdebug_aranges) }
    185   .debug_pubnames 0 : { *(.debug_pubnames .zdebug_pubnames) }
    186   /* DWARF 2 */
    187   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.* .zdebug_info) }
    188   .debug_abbrev   0 : { *(.debug_abbrev .zdebug_abbrev) }
    189   .debug_line     0 : { *(.debug_line .zdebug_line) }
    190   .debug_frame    0 : { *(.debug_frame .zdebug_frame) }
    191   .debug_str      0 : { *(.debug_str .zdebug_str) }
    192   .debug_loc      0 : { *(.debug_loc .zdebug_loc) }
    193   .debug_macinfo  0 : { *(.debug_macinfo .zdebug_macinfo) }
    194   /* SGI/MIPS DWARF 2 extensions */
    195   .debug_weaknames 0 : { *(.debug_weaknames .zdebug_weaknames) }
    196   .debug_funcnames 0 : { *(.debug_funcnames .zdebug_funcnames) }
    197   .debug_typenames 0 : { *(.debug_typenames .zdebug_typenames) }
    198   .debug_varnames  0 : { *(.debug_varnames .zdebug_varnames) }
    199   /* DWARF 3 */
    200   .debug_pubtypes 0 : { *(.debug_pubtypes .zdebug_pubtypes) }
    201   .debug_ranges   0 : { *(.debug_ranges .zdebug_ranges) }
    202   .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
    203   /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
    204 }
    205