2 * The common part of the default linker scripts for standalone
3 * executables running on a Moxie processor.
5 * Copyright (C) 2008 Anthony Green
7 * The authors hereby grant permission to use, copy, modify,
8 * distribute, and license this software and its documentation for any
9 * purpose, provided that existing copyright notices are retained in
10 * all copies and that this notice is included verbatim in any
11 * distributions. No written agreement, license, or royalty fee is
12 * required for any of the authorized uses. Modifications to this
13 * software may be copyrighted by their authors and need not follow
14 * the licensing terms described here, provided that the new terms are
15 * clearly indicated on the first page of each file where they apply.
18 OUTPUT_FORMAT("elf32-moxie")
23 /* Read-only sections, merged into text segment: */
25 .interp : { *(.interp) }
27 .dynsym : { *(.dynsym) }
28 .dynstr : { *(.dynstr) }
29 .gnu.version : { *(.gnu.version) }
30 .gnu.version_d : { *(.gnu.version_d) }
31 .gnu.version_r : { *(.gnu.version_r) }
32 .rel.init : { *(.rel.init) }
33 .rela.init : { *(.rela.init) }
38 *(.rel.gnu.linkonce.t*)
44 *(.rela.gnu.linkonce.t*)
46 .rel.fini : { *(.rel.fini) }
47 .rela.fini : { *(.rela.fini) }
52 *(.rel.gnu.linkonce.r*)
58 *(.rela.gnu.linkonce.r*)
64 *(.rel.gnu.linkonce.d*)
70 *(.rela.gnu.linkonce.d*)
72 .rel.ctors : { *(.rel.ctors) }
73 .rela.ctors : { *(.rela.ctors) }
74 .rel.dtors : { *(.rel.dtors) }
75 .rela.dtors : { *(.rela.dtors) }
76 .rel.got : { *(.rel.got) }
77 .rela.got : { *(.rela.got) }
82 *(.rel.gnu.linkonce.s*)
88 *(.rela.gnu.linkonce.s*)
90 .rel.sbss : { *(.rel.sbss) }
91 .rela.sbss : { *(.rela.sbss) }
92 .rel.bss : { *(.rel.bss) }
93 .rela.bss : { *(.rela.bss) }
94 .rel.plt : { *(.rel.plt) }
95 .rela.plt : { *(.rela.plt) }
102 /* .gnu.warning sections are handled specially by elf32.em. */
105 *(.glue_7t) *(.glue_7)
117 .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*) }
118 .rodata1 : { *(.rodata1) }
119 .eh_frame_hdr : { *(.eh_frame_hdr) }
120 /* Adjust the address for the data segment. We want to adjust up to
121 the same address within the page on the next page up. */
122 . = ALIGN(256) + (. & (256 - 1));
130 .data1 : { *(.data1) }
131 .eh_frame : { KEEP (*(.eh_frame)) }
132 .gcc_except_table : { *(.gcc_except_table) }
135 /* gcc uses crtbegin.o to find the start of
136 the constructors, so we make sure it is
137 first. Because this is a wildcard, it
138 doesn't matter if the user does not
139 actually link against crtbegin.o; the
140 linker won't look for a file to match a
141 wildcard. The wildcard also means that it
142 doesn't matter which directory crtbegin.o
144 KEEP (*crtbegin.o(.ctors))
145 /* We don't want to include the .ctor section from
146 from the crtend.o file until after the sorted ctors.
147 The .ctor section from the crtend file contains the
148 end of ctors marker and it must be last */
149 KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
150 KEEP (*(SORT(.ctors.*)))
155 KEEP (*crtbegin.o(.dtors))
156 KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
157 KEEP (*(SORT(.dtors.*)))
160 .jcr : { KEEP (*(.jcr)) }
161 .got : { *(.got.plt) *(.got) }
162 .dynamic : { *(.dynamic) }
163 /* We want the small data sections together, so single-instruction offsets
164 can access them all, and initialized data all before uninitialized, so
165 we can shorten the on-disk segment size. */
189 /* Align here to ensure that the .bss section occupies space up to
190 _end. Align after .bss to ensure correct alignment even if the
191 .bss section disappears because there are no input sections. */
196 _bss_end__ = . ; __bss_end__ = . ; __end__ = . ;
198 /* Stabs debugging sections. */
199 .stab 0 : { *(.stab) }
200 .stabstr 0 : { *(.stabstr) }
201 .stab.excl 0 : { *(.stab.excl) }
202 .stab.exclstr 0 : { *(.stab.exclstr) }
203 .stab.index 0 : { *(.stab.index) }
204 .stab.indexstr 0 : { *(.stab.indexstr) }
205 .comment 0 : { *(.comment) }
206 /* DWARF debug sections.
207 Symbols in the DWARF debugging sections are relative to the beginning
208 of the section so we begin them at 0. */
210 .debug 0 : { *(.debug) }
211 .line 0 : { *(.line) }
212 /* GNU DWARF 1 extensions */
213 .debug_srcinfo 0 : { *(.debug_srcinfo) }
214 .debug_sfnames 0 : { *(.debug_sfnames) }
215 /* DWARF 1.1 and DWARF 2 */
216 .debug_aranges 0 : { *(.debug_aranges) }
217 .debug_pubnames 0 : { *(.debug_pubnames) }
219 .debug_info 0 : { *(.debug_info) }
220 .debug_abbrev 0 : { *(.debug_abbrev) }
221 .debug_line 0 : { *(.debug_line) }
222 .debug_frame 0 : { *(.debug_frame) }
223 .debug_str 0 : { *(.debug_str) }
224 .debug_loc 0 : { *(.debug_loc) }
225 .debug_macinfo 0 : { *(.debug_macinfo) }
226 .debug_ranges 0 : { *(.debug_ranges) }
227 /* SGI/MIPS DWARF 2 extensions */
228 .debug_weaknames 0 : { *(.debug_weaknames) }
229 .debug_funcnames 0 : { *(.debug_funcnames) }
230 .debug_typenames 0 : { *(.debug_typenames) }
231 .debug_varnames 0 : { *(.debug_varnames) }
232 .stack 0x400000 : { _stack = .; *(.stack) }
233 /* These must appear regardless of . */