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