Commit | Line | Data |
---|---|---|
7c8bf1e8 MM |
1 | cat <<EOF |
2 | OUTPUT_FORMAT("${OUTPUT_FORMAT}","${OUTPUT_FORMAT}","${OUTPUT_FORMAT}") | |
3 | OUTPUT_ARCH(${ARCH}) | |
4 | ||
5 | MEMORY | |
6 | { | |
7 | text (rx) : ORIGIN = 0, LENGTH = $TEXT_LENGTH | |
8 | data (rw!x) : ORIGIN = 0x800060, LENGTH = $DATA_LENGTH | |
9 | eeprom (rw!x) : ORIGIN = 0x810000, LENGTH = 64K | |
10 | } | |
11 | ||
12 | SECTIONS | |
13 | { | |
14 | /* Read-only sections, merged into text segment: */ | |
15 | ${TEXT_DYNAMIC+${DYNAMIC}} | |
16 | .hash ${RELOCATING-0} : { *(.hash) } | |
17 | .dynsym ${RELOCATING-0} : { *(.dynsym) } | |
18 | .dynstr ${RELOCATING-0} : { *(.dynstr) } | |
19 | .gnu.version ${RELOCATING-0} : { *(.gnu.version) } | |
20 | .gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) } | |
21 | .gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) } | |
22 | ||
0c9b4fee | 23 | .rel.init ${RELOCATING-0} : { *(.rel.init) } |
7c8bf1e8 MM |
24 | .rela.init ${RELOCATING-0} : { *(.rela.init) } |
25 | .rel.text ${RELOCATING-0} : | |
26 | { | |
27 | *(.rel.text) | |
28 | ${RELOCATING+*(.rel.text.*)} | |
29 | ${RELOCATING+*(.rel.gnu.linkonce.t*)} | |
30 | } | |
31 | .rela.text ${RELOCATING-0} : | |
32 | { | |
33 | *(.rela.text) | |
34 | ${RELOCATING+*(.rela.text.*)} | |
35 | ${RELOCATING+*(.rela.gnu.linkonce.t*)} | |
36 | } | |
0c9b4fee | 37 | .rel.fini ${RELOCATING-0} : { *(.rel.fini) } |
7c8bf1e8 MM |
38 | .rela.fini ${RELOCATING-0} : { *(.rela.fini) } |
39 | .rel.rodata ${RELOCATING-0} : | |
40 | { | |
41 | *(.rel.rodata) | |
42 | ${RELOCATING+*(.rel.rodata.*)} | |
43 | ${RELOCATING+*(.rel.gnu.linkonce.r*)} | |
44 | } | |
45 | .rela.rodata ${RELOCATING-0} : | |
46 | { | |
47 | *(.rela.rodata) | |
48 | ${RELOCATING+*(.rela.rodata.*)} | |
49 | ${RELOCATING+*(.rela.gnu.linkonce.r*)} | |
50 | } | |
51 | .rel.data ${RELOCATING-0} : | |
52 | { | |
53 | *(.rel.data) | |
54 | ${RELOCATING+*(.rel.data.*)} | |
55 | ${RELOCATING+*(.rel.gnu.linkonce.d*)} | |
56 | } | |
57 | .rela.data ${RELOCATING-0} : | |
58 | { | |
59 | *(.rela.data) | |
60 | ${RELOCATING+*(.rela.data.*)} | |
61 | ${RELOCATING+*(.rela.gnu.linkonce.d*)} | |
62 | } | |
63 | .rel.ctors ${RELOCATING-0} : { *(.rel.ctors) } | |
64 | .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) } | |
65 | .rel.dtors ${RELOCATING-0} : { *(.rel.dtors) } | |
66 | .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) } | |
67 | .rel.got ${RELOCATING-0} : { *(.rel.got) } | |
68 | .rela.got ${RELOCATING-0} : { *(.rela.got) } | |
69 | .rel.bss ${RELOCATING-0} : { *(.rel.bss) } | |
70 | .rela.bss ${RELOCATING-0} : { *(.rela.bss) } | |
71 | .rel.plt ${RELOCATING-0} : { *(.rel.plt) } | |
72 | .rela.plt ${RELOCATING-0} : { *(.rela.plt) } | |
73 | ||
28c9d252 | 74 | /* Internal text space or external memory. */ |
7c8bf1e8 MM |
75 | .text : |
76 | { | |
0c9b4fee | 77 | *(.vectors) |
df406460 | 78 | KEEP(*(.vectors)) |
0c9b4fee | 79 | |
28c9d252 NC |
80 | /* For data that needs to reside in the lower 64k of progmem. */ |
81 | *(.progmem.gcc*) | |
82 | *(.progmem*) | |
83 | ${RELOCATING+. = ALIGN(2);} | |
84 | ||
85 | ${CONSTRUCTING+ __trampolines_start = . ; } | |
86 | /* The jump trampolines for the 16-bit limited relocs will reside here. */ | |
87 | *(.trampolines) | |
88 | *(.trampolines*) | |
89 | ${CONSTRUCTING+ __trampolines_end = . ; } | |
90 | ||
91 | /* For future tablejump instruction arrays for 3 byte pc devices. | |
92 | We don't relax jump/call instructions within these sections. */ | |
93 | *(.jumptables) | |
94 | *(.jumptables*) | |
95 | ||
96 | /* For code that needs to reside in the lower 128k progmem. */ | |
97 | *(.lowtext) | |
98 | *(.lowtext*) | |
99 | ||
0c9b4fee MM |
100 | ${CONSTRUCTING+ __ctors_start = . ; } |
101 | ${CONSTRUCTING+ *(.ctors) } | |
102 | ${CONSTRUCTING+ __ctors_end = . ; } | |
103 | ${CONSTRUCTING+ __dtors_start = . ; } | |
104 | ${CONSTRUCTING+ *(.dtors) } | |
105 | ${CONSTRUCTING+ __dtors_end = . ; } | |
df406460 NC |
106 | KEEP(SORT(*)(.ctors)) |
107 | KEEP(SORT(*)(.dtors)) | |
0c9b4fee | 108 | |
28c9d252 NC |
109 | /* From this point on, we don't bother about wether the insns are |
110 | below or above the 16 bits boundary. */ | |
0c9b4fee | 111 | *(.init0) /* Start here after reset. */ |
df406460 | 112 | KEEP (*(.init0)) |
0c9b4fee | 113 | *(.init1) |
df406460 | 114 | KEEP (*(.init1)) |
0c9b4fee | 115 | *(.init2) /* Clear __zero_reg__, set up stack pointer. */ |
df406460 | 116 | KEEP (*(.init2)) |
0c9b4fee | 117 | *(.init3) |
df406460 | 118 | KEEP (*(.init3)) |
0c9b4fee | 119 | *(.init4) /* Initialize data and BSS. */ |
df406460 | 120 | KEEP (*(.init4)) |
0c9b4fee | 121 | *(.init5) |
df406460 | 122 | KEEP (*(.init5)) |
0c9b4fee | 123 | *(.init6) /* C++ constructors. */ |
df406460 | 124 | KEEP (*(.init6)) |
0c9b4fee | 125 | *(.init7) |
df406460 | 126 | KEEP (*(.init7)) |
0c9b4fee | 127 | *(.init8) |
df406460 | 128 | KEEP (*(.init8)) |
0c9b4fee | 129 | *(.init9) /* Call main(). */ |
df406460 | 130 | KEEP (*(.init9)) |
7c8bf1e8 MM |
131 | *(.text) |
132 | ${RELOCATING+. = ALIGN(2);} | |
133 | *(.text.*) | |
134 | ${RELOCATING+. = ALIGN(2);} | |
0c9b4fee | 135 | *(.fini9) /* _exit() starts here. */ |
df406460 | 136 | KEEP (*(.fini9)) |
0c9b4fee | 137 | *(.fini8) |
df406460 | 138 | KEEP (*(.fini8)) |
0c9b4fee | 139 | *(.fini7) |
df406460 | 140 | KEEP (*(.fini7)) |
0c9b4fee | 141 | *(.fini6) /* C++ destructors. */ |
df406460 | 142 | KEEP (*(.fini6)) |
0c9b4fee | 143 | *(.fini5) |
df406460 | 144 | KEEP (*(.fini5)) |
0c9b4fee | 145 | *(.fini4) |
df406460 | 146 | KEEP (*(.fini4)) |
0c9b4fee | 147 | *(.fini3) |
df406460 | 148 | KEEP (*(.fini3)) |
0c9b4fee | 149 | *(.fini2) |
df406460 | 150 | KEEP (*(.fini2)) |
0c9b4fee | 151 | *(.fini1) |
df406460 | 152 | KEEP (*(.fini1)) |
0c9b4fee | 153 | *(.fini0) /* Infinite loop after program termination. */ |
df406460 | 154 | KEEP (*(.fini0)) |
7c8bf1e8 MM |
155 | ${RELOCATING+ _etext = . ; } |
156 | } ${RELOCATING+ > text} | |
157 | ||
158 | .data ${RELOCATING-0} : ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text))} | |
159 | { | |
160 | ${RELOCATING+ PROVIDE (__data_start = .) ; } | |
161 | *(.data) | |
df406460 NC |
162 | *(.data*) |
163 | *(.rodata) /* We need to include .rodata here if gcc is used */ | |
164 | *(.rodata*) /* with -fdata-sections. */ | |
7c8bf1e8 MM |
165 | *(.gnu.linkonce.d*) |
166 | ${RELOCATING+. = ALIGN(2);} | |
167 | ${RELOCATING+ _edata = . ; } | |
0c9b4fee | 168 | ${RELOCATING+ PROVIDE (__data_end = .) ; } |
7c8bf1e8 MM |
169 | } ${RELOCATING+ > data} |
170 | ||
171 | .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} : | |
172 | { | |
173 | ${RELOCATING+ PROVIDE (__bss_start = .) ; } | |
174 | *(.bss) | |
df406460 | 175 | *(.bss*) |
7c8bf1e8 MM |
176 | *(COMMON) |
177 | ${RELOCATING+ PROVIDE (__bss_end = .) ; } | |
0c9b4fee MM |
178 | } ${RELOCATING+ > data} |
179 | ||
180 | ${RELOCATING+ __data_load_start = LOADADDR(.data); } | |
181 | ${RELOCATING+ __data_load_end = __data_load_start + SIZEOF(.data); } | |
182 | ||
183 | /* Global data not cleared after reset. */ | |
184 | .noinit ${RELOCATING+ SIZEOF(.bss) + ADDR(.bss)} : | |
185 | { | |
186 | ${RELOCATING+ PROVIDE (__noinit_start = .) ; } | |
187 | *(.noinit*) | |
188 | ${RELOCATING+ PROVIDE (__noinit_end = .) ; } | |
7c8bf1e8 | 189 | ${RELOCATING+ _end = . ; } |
0c9b4fee | 190 | ${RELOCATING+ PROVIDE (__heap_start = .) ; } |
7c8bf1e8 MM |
191 | } ${RELOCATING+ > data} |
192 | ||
193 | .eeprom ${RELOCATING-0}: | |
7c8bf1e8 MM |
194 | { |
195 | *(.eeprom*) | |
196 | ${RELOCATING+ __eeprom_end = . ; } | |
197 | } ${RELOCATING+ > eeprom} | |
198 | ||
199 | /* Stabs debugging sections. */ | |
200 | .stab 0 : { *(.stab) } | |
201 | .stabstr 0 : { *(.stabstr) } | |
202 | .stab.excl 0 : { *(.stab.excl) } | |
203 | .stab.exclstr 0 : { *(.stab.exclstr) } | |
204 | .stab.index 0 : { *(.stab.index) } | |
205 | .stab.indexstr 0 : { *(.stab.indexstr) } | |
206 | .comment 0 : { *(.comment) } | |
207 | ||
208 | /* DWARF debug sections. | |
209 | Symbols in the DWARF debugging sections are relative to the beginning | |
210 | of the section so we begin them at 0. */ | |
211 | ||
212 | /* DWARF 1 */ | |
213 | .debug 0 : { *(.debug) } | |
214 | .line 0 : { *(.line) } | |
215 | ||
216 | /* GNU DWARF 1 extensions */ | |
217 | .debug_srcinfo 0 : { *(.debug_srcinfo) } | |
218 | .debug_sfnames 0 : { *(.debug_sfnames) } | |
219 | ||
220 | /* DWARF 1.1 and DWARF 2 */ | |
221 | .debug_aranges 0 : { *(.debug_aranges) } | |
222 | .debug_pubnames 0 : { *(.debug_pubnames) } | |
223 | ||
224 | /* DWARF 2 */ | |
225 | .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) } | |
226 | .debug_abbrev 0 : { *(.debug_abbrev) } | |
227 | .debug_line 0 : { *(.debug_line) } | |
228 | .debug_frame 0 : { *(.debug_frame) } | |
229 | .debug_str 0 : { *(.debug_str) } | |
230 | .debug_loc 0 : { *(.debug_loc) } | |
231 | .debug_macinfo 0 : { *(.debug_macinfo) } | |
232 | } | |
233 | EOF | |
234 |