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