1 | /* |
---|
2 | * Linker command file for Intec SS555 board |
---|
3 | * |
---|
4 | * When debugging, we assume that the internal flash ROM will be replaced by |
---|
5 | * the external RAM on the SS555 board. All sections are stacked starting |
---|
6 | * at address zero. Nothing is placed in the internal RAM, since it's not |
---|
7 | * contiguous with the external SRAM when the external RAM is placed at |
---|
8 | * zero. |
---|
9 | * |
---|
10 | * For final production, we assume that the .text section will be burned |
---|
11 | * into flash ROM starting at address zero. The .data, .bss, heap, and |
---|
12 | * workspace will reside in RAM, starting at the beginning of the internal |
---|
13 | * RAM. The system startup code will configure the external RAM to begin |
---|
14 | * where the internal RAM ends, so as to make one large RAM block. |
---|
15 | * |
---|
16 | * Debugging mode is chosen when the RTEMS_DEBUG symbol is defined. The |
---|
17 | * RTEMS_DEBUG symbol is defined in the bsp_specs file whenever make(1) is |
---|
18 | * invoked with VARIANT=DEBUG. |
---|
19 | * |
---|
20 | * $Id$ |
---|
21 | */ |
---|
22 | |
---|
23 | OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc") |
---|
24 | OUTPUT_ARCH(powerpc) |
---|
25 | ENTRY(start) |
---|
26 | |
---|
27 | int_ram_org = 0x003F9800; /* base of internal RAM */ |
---|
28 | int_ram_top = 0x00400000; /* top of internal RAM */ |
---|
29 | ext_ram_size = 0x00080000; /* size of external RAM */ |
---|
30 | |
---|
31 | RamBase = DEFINED(_RamBase) ? RamBase : 0x003F9800; |
---|
32 | RamSize = DEFINED(_RamSize) ? RamSize : 0x00486800; |
---|
33 | HeapSize = DEFINED(_HeapSize) ? HeapSize : 0x0; |
---|
34 | |
---|
35 | SECTIONS |
---|
36 | { |
---|
37 | .vectors 0x0: |
---|
38 | { |
---|
39 | /* |
---|
40 | * For the MPC555, we use the compressed vector table format which puts |
---|
41 | * all of the exception vectors before 0x100. |
---|
42 | */ |
---|
43 | *(.vectors) |
---|
44 | } |
---|
45 | |
---|
46 | .text 0x100: |
---|
47 | { |
---|
48 | /* Read-only sections, merged into text segment: */ |
---|
49 | |
---|
50 | text.start = .; |
---|
51 | |
---|
52 | /* Entry point is the .entry section */ |
---|
53 | *(.entry) |
---|
54 | *(.entry2) |
---|
55 | |
---|
56 | /* Actual code */ |
---|
57 | *(.text*) |
---|
58 | |
---|
59 | /* C++ constructors/destructors */ |
---|
60 | *(.gnu.linkonce.t*) |
---|
61 | |
---|
62 | /* Initialization and finalization code. |
---|
63 | * |
---|
64 | * Various files can provide initialization and finalization functions. |
---|
65 | * The bodies of these functions are in .init and .fini sections. We |
---|
66 | * accumulate the bodies here, and prepend function prologues from |
---|
67 | * ecrti.o and function epilogues from ecrtn.o. ecrti.o must be linked |
---|
68 | * first; ecrtn.o must be linked last. Because these are wildcards, it |
---|
69 | * doesn't matter if the user does not actually link against ecrti.o and |
---|
70 | * ecrtn.o; the linker won't look for a file to match a wildcard. The |
---|
71 | * wildcard also means that it doesn't matter which directory ecrti.o |
---|
72 | * and ecrtn.o are in. |
---|
73 | */ |
---|
74 | PROVIDE (_init = .); |
---|
75 | *ecrti.o(.init) |
---|
76 | *(.init) |
---|
77 | *ecrtn.o(.init) |
---|
78 | |
---|
79 | PROVIDE (_fini = .); |
---|
80 | *ecrti.o(.fini) |
---|
81 | *(.fini) |
---|
82 | *ecrtn.o(.init) |
---|
83 | |
---|
84 | /* |
---|
85 | * C++ constructors and destructors for static objects. |
---|
86 | * PowerPC EABI does not use crtstuff yet, so we build "old-style" |
---|
87 | * constructor and destructor lists that begin with the list length |
---|
88 | * end terminate with a NULL entry. |
---|
89 | */ |
---|
90 | PROVIDE (__CTOR_LIST__ = .); |
---|
91 | /* LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) */ |
---|
92 | *crtbegin.o(.ctors) |
---|
93 | *(.ctors) |
---|
94 | *crtend.o(.ctors) |
---|
95 | LONG(0) |
---|
96 | PROVIDE (__CTOR_END__ = .); |
---|
97 | |
---|
98 | PROVIDE (__DTOR_LIST__ = .); |
---|
99 | /* LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2) */ |
---|
100 | *crtbegin.o(.dtors) |
---|
101 | *(.dtors) |
---|
102 | *crtend.o(.dtors) |
---|
103 | LONG(0) |
---|
104 | PROVIDE (__DTOR_END__ = .); |
---|
105 | |
---|
106 | /* |
---|
107 | * Special FreeBSD sysctl sections. |
---|
108 | */ |
---|
109 | . = ALIGN (16); |
---|
110 | __start_set_sysctl_set = .; |
---|
111 | *(set_sysctl_*); |
---|
112 | __stop_set_sysctl_set = ABSOLUTE(.); |
---|
113 | *(set_domain_*); |
---|
114 | *(set_pseudo_*); |
---|
115 | |
---|
116 | /* Exception frame info */ |
---|
117 | *(.eh_frame) |
---|
118 | |
---|
119 | /* Miscellaneous read-only data */ |
---|
120 | _rodata_start = . ; |
---|
121 | *(.gnu.linkonce.r*) |
---|
122 | *(.lit) |
---|
123 | *(.shdata) |
---|
124 | *(.rodata*) |
---|
125 | *(.rodata1) |
---|
126 | *(.descriptors) |
---|
127 | *(rom_ver) |
---|
128 | _erodata = .; |
---|
129 | |
---|
130 | /* Various possible names for the end of the .text section */ |
---|
131 | etext = ALIGN(0x10); |
---|
132 | _etext = .; |
---|
133 | _endtext = .; |
---|
134 | text.end = .; |
---|
135 | PROVIDE (etext = .); |
---|
136 | PROVIDE (__etext = .); |
---|
137 | |
---|
138 | /* |
---|
139 | * .data section contents, copied to RAM at system startup. |
---|
140 | */ |
---|
141 | . = ALIGN(0x20); |
---|
142 | data.contents.start = .; |
---|
143 | } |
---|
144 | text.size = text.end - text.start; |
---|
145 | |
---|
146 | /* |
---|
147 | * If debugging, stack the read/write sections directly after the text |
---|
148 | * section. Otherwise, stack the read/write sections starting at base of |
---|
149 | * internal RAM. |
---|
150 | */ |
---|
151 | . = DEFINED(RTEMS_DEBUG) ? . : int_ram_org; |
---|
152 | |
---|
153 | .data : AT (data.contents.start) |
---|
154 | { |
---|
155 | data.start = .; |
---|
156 | |
---|
157 | *(.data) |
---|
158 | *(.data.*) |
---|
159 | *(.data1) |
---|
160 | |
---|
161 | PROVIDE (__SDATA_START__ = .); |
---|
162 | *(.sdata*) |
---|
163 | *(.gnu.linkonce.d*) |
---|
164 | *(.gnu.linkonce.s.*) |
---|
165 | PROVIDE (__SDATA_END__ = .); |
---|
166 | |
---|
167 | PROVIDE (__EXCEPT_START__ = .); |
---|
168 | *(.gcc_except_table*) |
---|
169 | PROVIDE (__EXCEPT_END__ = .); |
---|
170 | |
---|
171 | PROVIDE(__GOT_START__ = .); |
---|
172 | *(.got.plt) |
---|
173 | *(.got) |
---|
174 | PROVIDE(__GOT_END__ = .); |
---|
175 | |
---|
176 | *(.got1) |
---|
177 | |
---|
178 | PROVIDE (__GOT2_START__ = .); |
---|
179 | PROVIDE (_GOT2_START_ = .); |
---|
180 | *(.got2) |
---|
181 | PROVIDE (__GOT2_END__ = .); |
---|
182 | PROVIDE (_GOT2_END_ = .); |
---|
183 | |
---|
184 | PROVIDE (__FIXUP_START__ = .); |
---|
185 | PROVIDE (_FIXUP_START_ = .); |
---|
186 | *(.fixup) |
---|
187 | PROVIDE (_FIXUP_END_ = .); |
---|
188 | PROVIDE (__FIXUP_END__ = .); |
---|
189 | |
---|
190 | /* We want the small data sections together, so single-instruction |
---|
191 | * offsets can access them all. |
---|
192 | */ |
---|
193 | PROVIDE (__SDATA2_START__ = .); |
---|
194 | *(.sdata2) |
---|
195 | *(.gnu.linkonce.s2.*) |
---|
196 | PROVIDE (__SDATA2_END__ = .); |
---|
197 | |
---|
198 | data.end = .; |
---|
199 | } |
---|
200 | data.size = data.end - data.start; |
---|
201 | |
---|
202 | .bss : |
---|
203 | { |
---|
204 | bss.start = .; |
---|
205 | |
---|
206 | PROVIDE (__SBSS2_START__ = .); |
---|
207 | *(.sbss2) |
---|
208 | PROVIDE (__SBSS2_END__ = .); |
---|
209 | |
---|
210 | PROVIDE (__SBSS_START__ = .); |
---|
211 | *(.sbss*) |
---|
212 | PROVIDE (__SBSS_END__ = .); |
---|
213 | |
---|
214 | *(.bss .bss* .gnu.linkonce.b*) |
---|
215 | *(COMMON) |
---|
216 | |
---|
217 | . = ALIGN(4); |
---|
218 | bss.end = .; |
---|
219 | } |
---|
220 | bss.size = bss.end - bss.start; |
---|
221 | |
---|
222 | PROVIDE(_end = bss.end); |
---|
223 | |
---|
224 | /* |
---|
225 | * Initialization stack |
---|
226 | */ |
---|
227 | InitStack_start = ALIGN(0x10); |
---|
228 | . += 0x1000; |
---|
229 | initStack = .; |
---|
230 | PROVIDE(initStackPtr = initStack); |
---|
231 | |
---|
232 | /* |
---|
233 | * Interrupt stack |
---|
234 | */ |
---|
235 | IntrStack_start = ALIGN(0x10); |
---|
236 | . += 0x4000; |
---|
237 | intrStack = .; |
---|
238 | PROVIDE(intrStackPtr = intrStack); |
---|
239 | |
---|
240 | /* |
---|
241 | * Work Area |
---|
242 | * |
---|
243 | * The Work Area is configured at run-time to use all available memory. It |
---|
244 | * begins just after the end of the Workspace and continues to the end of |
---|
245 | * the external RAM. |
---|
246 | */ |
---|
247 | . = DEFINED(RTEMS_DEBUG) ? 0 + ext_ram_size : int_ram_top + ext_ram_size; |
---|
248 | WorkAreaBase = .; |
---|
249 | |
---|
250 | |
---|
251 | /* |
---|
252 | * Internal I/O devices |
---|
253 | */ |
---|
254 | .usiu 0x002FC000: /* unified system interface unit */ |
---|
255 | { |
---|
256 | usiu = .; |
---|
257 | } |
---|
258 | |
---|
259 | .imb 0x00300000: /* inter-module bus and devices */ |
---|
260 | { |
---|
261 | imb = .; |
---|
262 | } |
---|
263 | |
---|
264 | .sram 0x00380000: /* internal SRAM control registers */ |
---|
265 | { |
---|
266 | sram = .; |
---|
267 | } |
---|
268 | |
---|
269 | /* |
---|
270 | * SS555 external devices managed by on-board CPLD |
---|
271 | */ |
---|
272 | .cpld 0xFF000000: /* SS555 external CPLD devices */ |
---|
273 | { |
---|
274 | cpld = .; |
---|
275 | } |
---|
276 | |
---|
277 | |
---|
278 | /* Stabs debugging sections. */ |
---|
279 | .stab 0 : { *(.stab) } |
---|
280 | .stabstr 0 : { *(.stabstr) } |
---|
281 | .stab.excl 0 : { *(.stab.excl) } |
---|
282 | .stab.exclstr 0 : { *(.stab.exclstr) } |
---|
283 | .stab.index 0 : { *(.stab.index) } |
---|
284 | .stab.indexstr 0 : { *(.stab.indexstr) } |
---|
285 | .comment 0 : { *(.comment) } |
---|
286 | |
---|
287 | /* DWARF debug sections. |
---|
288 | Symbols in the DWARF debugging sections are relative to the beginning |
---|
289 | of the section so we begin them at 0. */ |
---|
290 | /* DWARF 1 */ |
---|
291 | .debug 0 : { *(.debug) } |
---|
292 | .line 0 : { *(.line) } |
---|
293 | |
---|
294 | /* GNU DWARF 1 extensions */ |
---|
295 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
---|
296 | .debug_sfnames 0 : { *(.debug_sfnames) } |
---|
297 | |
---|
298 | /* DWARF 1.1 and DWARF 2 */ |
---|
299 | .debug_aranges 0 : { *(.debug_aranges) } |
---|
300 | .debug_pubnames 0 : { *(.debug_pubnames) } |
---|
301 | |
---|
302 | /* DWARF 2 */ |
---|
303 | .debug_info 0 : { *(.debug_info) } |
---|
304 | .debug_abbrev 0 : { *(.debug_abbrev) } |
---|
305 | .debug_line 0 : { *(.debug_line) } |
---|
306 | .debug_frame 0 : { *(.debug_frame) } |
---|
307 | .debug_str 0 : { *(.debug_str) } |
---|
308 | .debug_loc 0 : { *(.debug_loc) } |
---|
309 | .debug_macinfo 0 : { *(.debug_macinfo) } |
---|
310 | |
---|
311 | /* SGI/MIPS DWARF 2 extensions */ |
---|
312 | .debug_weaknames 0 : { *(.debug_weaknames) } |
---|
313 | .debug_funcnames 0 : { *(.debug_funcnames) } |
---|
314 | .debug_typenames 0 : { *(.debug_typenames) } |
---|
315 | .debug_varnames 0 : { *(.debug_varnames) } |
---|
316 | /* These must appear regardless of . */ |
---|
317 | } |
---|