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