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