1 | /* |
---|
2 | * This file contains directives for the GNU linker which are specific |
---|
3 | * to the MPC8260ADS Board |
---|
4 | */ |
---|
5 | |
---|
6 | OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", |
---|
7 | "elf32-powerpc") |
---|
8 | OUTPUT_ARCH(powerpc) |
---|
9 | |
---|
10 | ENTRY(start) |
---|
11 | STARTUP(start.o) |
---|
12 | EXTERN(__vectors) |
---|
13 | |
---|
14 | /* |
---|
15 | * Declare some sizes. |
---|
16 | * XXX: The assignment of ". += XyzSize;" fails in older gld's if the |
---|
17 | * number used there is not constant. If this happens to you, edit |
---|
18 | * the lines marked XXX below to use a constant value. |
---|
19 | */ |
---|
20 | StackSize = DEFINED(StackSize) ? StackSize : 0x8000; |
---|
21 | RamBase = DEFINED(RamBase) ? RamBase : 0x0; |
---|
22 | RamSize = DEFINED(RamSize) ? RamDiskSize : 0x0800000; /* 8M program ram */ |
---|
23 | HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0; |
---|
24 | RamDiskBase = DEFINED(RamDiskBase) ? RamDiskBase : 0x0800000; |
---|
25 | RamDiskSize = DEFINED(RamDiskSize) ? RamDiskSize : 0x0800000; /* 8M ram disk */ |
---|
26 | |
---|
27 | MEMORY |
---|
28 | { |
---|
29 | ram : org = 0x0, l = 8M |
---|
30 | ramdisk : org = 0x0800000, l = 8M |
---|
31 | dpram : org = 0x04700000, l = 128K |
---|
32 | flash : org = 0xff800000, l = 8M |
---|
33 | } |
---|
34 | |
---|
35 | |
---|
36 | SECTIONS |
---|
37 | { |
---|
38 | /* |
---|
39 | * The stack will live in this area - between the vectors and |
---|
40 | * the text section. |
---|
41 | */ |
---|
42 | |
---|
43 | .text 0x10000: |
---|
44 | { |
---|
45 | _textbase = .; |
---|
46 | |
---|
47 | |
---|
48 | text.start = .; |
---|
49 | |
---|
50 | /* Entry point is the .entry section */ |
---|
51 | *(.entry) |
---|
52 | *(.entry2) |
---|
53 | |
---|
54 | /* Actual Code */ |
---|
55 | *(.text*) |
---|
56 | |
---|
57 | |
---|
58 | *(.rodata*) |
---|
59 | *(.rodata1) |
---|
60 | |
---|
61 | |
---|
62 | /* |
---|
63 | * Special FreeBSD sysctl sections. |
---|
64 | */ |
---|
65 | . = ALIGN (16); |
---|
66 | __start_set_sysctl_set = .; |
---|
67 | *(set_sysctl_*); |
---|
68 | __stop_set_sysctl_set = ABSOLUTE(.); |
---|
69 | *(set_domain_*); |
---|
70 | *(set_pseudo_*); |
---|
71 | |
---|
72 | /* C++ constructors/destructors */ |
---|
73 | *(.gnu.linkonce.t*) |
---|
74 | |
---|
75 | /* Initialization and finalization code. |
---|
76 | * |
---|
77 | * Various files can provide initialization and finalization functions. |
---|
78 | * The bodies of these functions are in .init and .fini sections. We |
---|
79 | * accumulate the bodies here, and prepend function prologues from |
---|
80 | * ecrti.o and function epilogues from ecrtn.o. ecrti.o must be linked |
---|
81 | * first; ecrtn.o must be linked last. Because these are wildcards, it |
---|
82 | * doesn't matter if the user does not actually link against ecrti.o and |
---|
83 | * ecrtn.o; the linker won't look for a file to match a wildcard. The |
---|
84 | * wildcard also means that it doesn't matter which directory ecrti.o |
---|
85 | * and ecrtn.o are in. |
---|
86 | */ |
---|
87 | PROVIDE (_init = .); |
---|
88 | *ecrti.o(.init) |
---|
89 | *(.init) |
---|
90 | *ecrtn.o(.init) |
---|
91 | |
---|
92 | PROVIDE (_fini = .); |
---|
93 | *ecrti.o(.fini) |
---|
94 | *(.fini) |
---|
95 | *ecrtn.o(.init) |
---|
96 | |
---|
97 | /* |
---|
98 | * C++ constructors and destructors for static objects. |
---|
99 | * PowerPC EABI does not use crtstuff yet, so we build "old-style" |
---|
100 | * constructor and destructor lists that begin with the list length |
---|
101 | * end terminate with a NULL entry. |
---|
102 | */ |
---|
103 | |
---|
104 | PROVIDE (__CTOR_LIST__ = .); |
---|
105 | /* LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) */ |
---|
106 | *crtbegin.o(.ctors) |
---|
107 | *(.ctors) |
---|
108 | *crtend.o(.ctors) |
---|
109 | LONG(0) |
---|
110 | PROVIDE (__CTOR_END__ = .); |
---|
111 | |
---|
112 | PROVIDE (__DTOR_LIST__ = .); |
---|
113 | /* LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2) */ |
---|
114 | *crtbegin.o(.dtors) |
---|
115 | *(.dtors) |
---|
116 | *crtend.o(.dtors) |
---|
117 | LONG(0) |
---|
118 | PROVIDE (__DTOR_END__ = .); |
---|
119 | |
---|
120 | /* Exception frame info */ |
---|
121 | *(.eh_frame) |
---|
122 | |
---|
123 | /* Miscellaneous read-only data */ |
---|
124 | _rodata_start = . ; |
---|
125 | *(.gnu.linkonce.r*) |
---|
126 | *(.lit) |
---|
127 | *(.shdata) |
---|
128 | *(.rodata) |
---|
129 | *(.rodata1) |
---|
130 | KEEP (*(SORT(.rtemsroset.*))) |
---|
131 | *(.descriptors) |
---|
132 | *(rom_ver) |
---|
133 | _erodata = .; |
---|
134 | |
---|
135 | |
---|
136 | /* Various possible names for the end of the .text section */ |
---|
137 | etext = ALIGN(0x10); |
---|
138 | _etext = .; |
---|
139 | _endtext = .; |
---|
140 | text.end = .; |
---|
141 | PROVIDE (etext = .); |
---|
142 | PROVIDE (__etext = .); |
---|
143 | |
---|
144 | } > ram |
---|
145 | |
---|
146 | .tdata : { |
---|
147 | _TLS_Data_begin = .; |
---|
148 | *(.tdata .tdata.* .gnu.linkonce.td.*) |
---|
149 | _TLS_Data_end = .; |
---|
150 | } >ram |
---|
151 | |
---|
152 | .tbss : { |
---|
153 | _TLS_BSS_begin = .; |
---|
154 | *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) |
---|
155 | _TLS_BSS_end = .; |
---|
156 | } >ram |
---|
157 | |
---|
158 | _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin; |
---|
159 | _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin; |
---|
160 | _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin; |
---|
161 | _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin; |
---|
162 | _TLS_Size = _TLS_BSS_end - _TLS_Data_begin; |
---|
163 | _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss)); |
---|
164 | |
---|
165 | |
---|
166 | .rel.dyn : |
---|
167 | { |
---|
168 | *(.rel.init) |
---|
169 | *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) |
---|
170 | *(.rel.fini) |
---|
171 | *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) |
---|
172 | *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) |
---|
173 | *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) |
---|
174 | *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) |
---|
175 | *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) |
---|
176 | *(.rel.ctors) |
---|
177 | *(.rel.dtors) |
---|
178 | *(.rel.got) |
---|
179 | *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) |
---|
180 | *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) |
---|
181 | *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) |
---|
182 | *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) |
---|
183 | *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) |
---|
184 | } >ram |
---|
185 | .rela.dyn : |
---|
186 | { |
---|
187 | *(.rela.init) |
---|
188 | *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) |
---|
189 | *(.rela.fini) |
---|
190 | *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) |
---|
191 | *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) |
---|
192 | *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) |
---|
193 | *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) |
---|
194 | *(.rela.ctors) |
---|
195 | *(.rela.dtors) |
---|
196 | *(.rela.got) |
---|
197 | *(.rela.got1) |
---|
198 | *(.rela.got2) |
---|
199 | *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) |
---|
200 | *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) |
---|
201 | *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) |
---|
202 | *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) |
---|
203 | *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) |
---|
204 | } >ram |
---|
205 | .rel.plt : { *(.rel.plt) } |
---|
206 | .rela.plt : { *(.rela.plt) } |
---|
207 | |
---|
208 | PROVIDE (__EXCEPT_START__ = .); |
---|
209 | .gcc_except_table : { *(.gcc_except_table*) } >ram |
---|
210 | PROVIDE (__EXCEPT_END__ = .); |
---|
211 | __GOT_START__ = .; |
---|
212 | .got : |
---|
213 | { |
---|
214 | s.got = .; |
---|
215 | *(.got.plt) *(.got) |
---|
216 | } > ram |
---|
217 | __GOT_END__ = .; |
---|
218 | |
---|
219 | .got1 : { *(.got1) } >ram |
---|
220 | PROVIDE (__GOT2_START__ = .); |
---|
221 | PROVIDE (_GOT2_START_ = .); |
---|
222 | .got2 : { *(.got2) } >ram |
---|
223 | PROVIDE (__GOT2_END__ = .); |
---|
224 | PROVIDE (_GOT2_END_ = .); |
---|
225 | |
---|
226 | PROVIDE (__FIXUP_START__ = .); |
---|
227 | PROVIDE (_FIXUP_START_ = .); |
---|
228 | .fixup : { *(.fixup) } >ram |
---|
229 | PROVIDE (_FIXUP_END_ = .); |
---|
230 | PROVIDE (__FIXUP_END__ = .); |
---|
231 | |
---|
232 | .sdata : { |
---|
233 | PROVIDE (_SDA_BASE_ = 32768); |
---|
234 | *(.sdata .sdata.* .gnu.linkonce.s.*) |
---|
235 | } > ram |
---|
236 | |
---|
237 | .sbss : { |
---|
238 | __bss_start = .; |
---|
239 | |
---|
240 | PROVIDE (__sbss_start = .); PROVIDE (___sbss_start = .); |
---|
241 | *(.scommon) |
---|
242 | *(.dynsbss) |
---|
243 | *(.sbss .sbss.* .gnu.linkonce.sb.*) |
---|
244 | PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .); |
---|
245 | } > ram |
---|
246 | |
---|
247 | .sdata2 : { |
---|
248 | PROVIDE (_SDA2_BASE_ = 32768); |
---|
249 | |
---|
250 | *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) |
---|
251 | } > ram =0 |
---|
252 | |
---|
253 | .sbss2 : { |
---|
254 | *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) |
---|
255 | } > ram =0 |
---|
256 | |
---|
257 | .bss : |
---|
258 | { |
---|
259 | bss.start = .; |
---|
260 | *(.bss .bss* .gnu.linkonce.b*) |
---|
261 | . = ALIGN(4); |
---|
262 | bss.end = .; |
---|
263 | } > ram |
---|
264 | |
---|
265 | /* R/W Data */ |
---|
266 | .data ( . ) : |
---|
267 | { |
---|
268 | . = ALIGN (4); |
---|
269 | |
---|
270 | data.start = .; |
---|
271 | |
---|
272 | *(.data) |
---|
273 | *(.data1) |
---|
274 | *(.data.* .gnu.linkonce.d.*) |
---|
275 | KEEP (*(SORT(.rtemsrwset.*))) |
---|
276 | PROVIDE (__SDATA_START__ = .); |
---|
277 | *(.sdata .sdata.* .gnu.linkonce.s.*) |
---|
278 | data.end = .; |
---|
279 | } > ram |
---|
280 | |
---|
281 | data.size = data.end - data.start; |
---|
282 | bss.size = bss.end - bss.start; |
---|
283 | text.size = text.end - text.start; |
---|
284 | |
---|
285 | PROVIDE(_end = data.end); |
---|
286 | |
---|
287 | .gzipmalloc : { |
---|
288 | . = ALIGN (16); |
---|
289 | _startmalloc = .; |
---|
290 | } >ram |
---|
291 | |
---|
292 | |
---|
293 | /* |
---|
294 | * Interrupt stack setup |
---|
295 | */ |
---|
296 | IntrStack_start = ALIGN(0x10); |
---|
297 | . += 0x4000; |
---|
298 | intrStack = .; |
---|
299 | PROVIDE(intrStackPtr = intrStack); |
---|
300 | |
---|
301 | |
---|
302 | clear_end = .; |
---|
303 | |
---|
304 | WorkAreaBase = .; |
---|
305 | |
---|
306 | /* Sections for compressed .text and .data */ |
---|
307 | /* after the .datarom section is an int specifying */ |
---|
308 | /* the length of the following compressed image */ |
---|
309 | /* Executes once then could get overwritten */ |
---|
310 | .textrom 0x100000 : |
---|
311 | { |
---|
312 | *(.textrom) |
---|
313 | _endloader = .; |
---|
314 | } > ram |
---|
315 | |
---|
316 | .datarom : |
---|
317 | { |
---|
318 | _dr_start = .; |
---|
319 | *(.datarom) |
---|
320 | _dr_end = .; |
---|
321 | } > ram |
---|
322 | dr_len = _dr_end - _dr_start; |
---|
323 | |
---|
324 | .dpram : |
---|
325 | { |
---|
326 | m8260 = .; |
---|
327 | _m8260 = .; |
---|
328 | . += (128 * 1024); |
---|
329 | } > dpram |
---|
330 | |
---|
331 | |
---|
332 | /* the reset vector is at 0xfff00000 which is */ |
---|
333 | /* located at offset 0x400000 from the base */ |
---|
334 | /* of flash */ |
---|
335 | .bootrom 0xFFF00000 : |
---|
336 | { |
---|
337 | *(.bootrom) |
---|
338 | _endboot = .; |
---|
339 | } > flash |
---|
340 | |
---|
341 | |
---|
342 | .line 0 : { *(.line) } |
---|
343 | .debug 0 : { *(.debug) } |
---|
344 | .debug_sfnames 0 : { *(.debug_sfnames) } |
---|
345 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
---|
346 | .debug_pubnames 0 : { *(.debug_pubnames) } |
---|
347 | .debug_aranges 0 : { *(.debug_aranges) } |
---|
348 | .debug_aregion 0 : { *(.debug_aregion) } |
---|
349 | .debug_macinfo 0 : { *(.debug_macinfo) } |
---|
350 | .stab 0 : { *(.stab) } |
---|
351 | .stabstr 0 : { *(.stabstr) } |
---|
352 | } |
---|