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