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