1 # Copyright (C) 2014 Free Software Foundation, Inc.
3 # Copying and distribution of this file, with or without modification,
4 # are permitted in any medium without royalty provided the copyright
5 # notice and this notice are preserved.
8 /* Copyright (C) 2014 Free Software Foundation, Inc.
10 Copying and distribution of this script, with or without modification,
11 are permitted in any medium without royalty provided the copyright
12 notice and this notice are preserved. */
14 OUTPUT_FORMAT("${OUTPUT_FORMAT}","${OUTPUT_FORMAT}","${OUTPUT_FORMAT}")
19 text (rx) : ORIGIN = $TEXT_ORIGIN, LENGTH = $TEXT_LENGTH
20 data (rw!x) : ORIGIN = $DATA_ORIGIN, LENGTH = $DATA_LENGTH
22 /* Provide offsets for config, lock and signature to match
23 production file format. Ignore offsets in datasheet. */
25 config (rw!x) : ORIGIN = 0x820000, LENGTH = 2
26 lock (rw!x) : ORIGIN = 0x830000, LENGTH = 2
27 signature (rw!x) : ORIGIN = 0x840000, LENGTH = 4
32 /* Read-only sections, merged into text segment: */
33 ${TEXT_DYNAMIC+${DYNAMIC}}
34 .hash ${RELOCATING-0} : { *(.hash) }
35 .dynsym ${RELOCATING-0} : { *(.dynsym) }
36 .dynstr ${RELOCATING-0} : { *(.dynstr) }
37 .gnu.version ${RELOCATING-0} : { *(.gnu.version) }
38 .gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) }
39 .gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) }
41 .rel.init ${RELOCATING-0} : { *(.rel.init) }
42 .rela.init ${RELOCATING-0} : { *(.rela.init) }
43 .rel.text ${RELOCATING-0} :
46 ${RELOCATING+*(.rel.text.*)}
47 ${RELOCATING+*(.rel.gnu.linkonce.t*)}
49 .rela.text ${RELOCATING-0} :
52 ${RELOCATING+*(.rela.text.*)}
53 ${RELOCATING+*(.rela.gnu.linkonce.t*)}
55 .rel.fini ${RELOCATING-0} : { *(.rel.fini) }
56 .rela.fini ${RELOCATING-0} : { *(.rela.fini) }
57 .rel.rodata ${RELOCATING-0} :
60 ${RELOCATING+*(.rel.rodata.*)}
61 ${RELOCATING+*(.rel.gnu.linkonce.r*)}
63 .rela.rodata ${RELOCATING-0} :
66 ${RELOCATING+*(.rela.rodata.*)}
67 ${RELOCATING+*(.rela.gnu.linkonce.r*)}
69 .rel.data ${RELOCATING-0} :
72 ${RELOCATING+*(.rel.data.*)}
73 ${RELOCATING+*(.rel.gnu.linkonce.d*)}
75 .rela.data ${RELOCATING-0} :
78 ${RELOCATING+*(.rela.data.*)}
79 ${RELOCATING+*(.rela.gnu.linkonce.d*)}
81 .rel.ctors ${RELOCATING-0} : { *(.rel.ctors) }
82 .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
83 .rel.dtors ${RELOCATING-0} : { *(.rel.dtors) }
84 .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
85 .rel.got ${RELOCATING-0} : { *(.rel.got) }
86 .rela.got ${RELOCATING-0} : { *(.rela.got) }
87 .rel.bss ${RELOCATING-0} : { *(.rel.bss) }
88 .rela.bss ${RELOCATING-0} : { *(.rela.bss) }
89 .rel.plt ${RELOCATING-0} : { *(.rel.plt) }
90 .rela.plt ${RELOCATING-0} : { *(.rela.plt) }
92 /* Internal text space or external memory. */
93 .text ${RELOCATING-0} : ${RELOCATING+ AT (0x0)}
98 /* For data that needs to reside in the lower 64k of progmem. */
101 ${RELOCATING+. = ALIGN(2);}
103 ${CONSTRUCTING+ __trampolines_start = . ; }
104 /* The jump trampolines for the 16-bit limited relocs will reside here. */
107 ${CONSTRUCTING+ __trampolines_end = . ; }
109 /* For future tablejump instruction arrays for 3 byte pc devices.
110 We don't relax jump/call instructions within these sections. */
114 /* For code that needs to reside in the lower 128k progmem. */
118 ${CONSTRUCTING+ __ctors_start = . ; }
119 ${CONSTRUCTING+ *(.ctors) }
120 ${CONSTRUCTING+ __ctors_end = . ; }
121 ${CONSTRUCTING+ __dtors_start = . ; }
122 ${CONSTRUCTING+ *(.dtors) }
123 ${CONSTRUCTING+ __dtors_end = . ; }
124 KEEP(SORT(*)(.ctors))
125 KEEP(SORT(*)(.dtors))
127 /* From this point on, we don't bother about wether the insns are
128 below or above the 16 bits boundary. */
129 *(.init0) /* Start here after reset. */
133 *(.init2) /* Clear __zero_reg__, set up stack pointer. */
137 *(.init4) /* Initialize data and BSS. */
141 *(.init6) /* C++ constructors. */
147 *(.init9) /* Call main(). */
150 ${RELOCATING+. = ALIGN(2);}
152 ${RELOCATING+. = ALIGN(2);}
153 *(.fini9) /* _exit() starts here. */
159 *(.fini6) /* C++ destructors. */
171 *(.fini0) /* Infinite loop after program termination. */
173 ${RELOCATING+ _etext = . ; }
174 } ${RELOCATING+ > text}
176 .data ${RELOCATING-0} : ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text))}
178 ${RELOCATING+ PROVIDE (__data_start = .) ; }
182 *(.rodata) /* We need to include .rodata here if gcc is used */
183 *(.rodata*) /* with -fdata-sections. */
185 ${RELOCATING+. = ALIGN(2);}
186 ${RELOCATING+ _edata = . ; }
187 ${RELOCATING+ PROVIDE (__data_end = .) ; }
188 } ${RELOCATING+ > data}
190 .bss ${RELOCATING-0} :${RELOCATING+ AT (ADDR (.bss))}
192 ${RELOCATING+ PROVIDE (__bss_start = .) ; }
196 ${RELOCATING+ PROVIDE (__bss_end = .) ; }
197 } ${RELOCATING+ > data}
199 ${RELOCATING+ __data_load_start = LOADADDR(.data); }
200 ${RELOCATING+ __data_load_end = __data_load_start + SIZEOF(.data); }
202 /* Global data not cleared after reset. */
203 .noinit ${RELOCATING-0}:
205 ${RELOCATING+ PROVIDE (__noinit_start = .) ; }
207 ${RELOCATING+ PROVIDE (__noinit_end = .) ; }
208 ${RELOCATING+ _end = . ; }
209 ${RELOCATING+ PROVIDE (__heap_start = .) ; }
210 } ${RELOCATING+ > data}
212 .lock ${RELOCATING-0}:
215 } ${RELOCATING+ > lock}
217 .signature ${RELOCATING-0}:
220 } ${RELOCATING+ > signature}
222 .config ${RELOCATING-0}:
225 } ${RELOCATING+ > config}
227 /* Stabs debugging sections. */
228 .stab 0 : { *(.stab) }
229 .stabstr 0 : { *(.stabstr) }
230 .stab.excl 0 : { *(.stab.excl) }
231 .stab.exclstr 0 : { *(.stab.exclstr) }
232 .stab.index 0 : { *(.stab.index) }
233 .stab.indexstr 0 : { *(.stab.indexstr) }
234 .comment 0 : { *(.comment) }
236 /* DWARF debug sections.
237 Symbols in the DWARF debugging sections are relative to the beginning
238 of the section so we begin them at 0. */
241 .debug 0 : { *(.debug) }
242 .line 0 : { *(.line) }
244 /* GNU DWARF 1 extensions */
245 .debug_srcinfo 0 : { *(.debug_srcinfo) }
246 .debug_sfnames 0 : { *(.debug_sfnames) }
248 /* DWARF 1.1 and DWARF 2 */
249 .debug_aranges 0 : { *(.debug_aranges) }
250 .debug_pubnames 0 : { *(.debug_pubnames) }
253 .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
254 .debug_abbrev 0 : { *(.debug_abbrev) }
255 .debug_line 0 : { *(.debug_line) }
256 .debug_frame 0 : { *(.debug_frame) }
257 .debug_str 0 : { *(.debug_str) }
258 .debug_loc 0 : { *(.debug_loc) }
259 .debug_macinfo 0 : { *(.debug_macinfo) }