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