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 | |
---|
17 | OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc") |
---|
18 | OUTPUT_ARCH(powerpc) |
---|
19 | STARTUP(start.o) |
---|
20 | ENTRY(start) |
---|
21 | EXTERN(_vectors) |
---|
22 | |
---|
23 | int_ram_org = 0x003F9800; /* base of internal RAM */ |
---|
24 | int_ram_top = 0x00400000; /* top of internal RAM */ |
---|
25 | ext_ram_size = 0x00080000; /* size of external RAM */ |
---|
26 | |
---|
27 | RamBase = DEFINED(_RamBase) ? RamBase : 0x003F9800; |
---|
28 | RamSize = DEFINED(_RamSize) ? RamSize : 0x00486800; |
---|
29 | RamEnd = RamBase + RamSize; |
---|
30 | HeapSize = DEFINED(_HeapSize) ? HeapSize : 0x0; |
---|
31 | |
---|
32 | SECTIONS |
---|
33 | { |
---|
34 | .vectors 0x0: |
---|
35 | { |
---|
36 | /* |
---|
37 | * For the MPC555, we use the compressed vector table format which puts |
---|
38 | * all of the exception vectors before 0x100. |
---|
39 | */ |
---|
40 | *(.vectors) |
---|
41 | } |
---|
42 | |
---|
43 | .text 0x100: |
---|
44 | { |
---|
45 | /* Read-only sections, merged into text segment: */ |
---|
46 | |
---|
47 | text.start = .; |
---|
48 | |
---|
49 | /* Entry point is the .entry section */ |
---|
50 | *(.entry) |
---|
51 | *(.entry2) |
---|
52 | |
---|
53 | /* Actual code */ |
---|
54 | *(.text*) |
---|
55 | |
---|
56 | /* C++ constructors/destructors */ |
---|
57 | *(.gnu.linkonce.t*) |
---|
58 | |
---|
59 | /* Initialization and finalization code. |
---|
60 | * |
---|
61 | * Various files can provide initialization and finalization functions. |
---|
62 | * The bodies of these functions are in .init and .fini sections. We |
---|
63 | * accumulate the bodies here, and prepend function prologues from |
---|
64 | * ecrti.o and function epilogues from ecrtn.o. ecrti.o must be linked |
---|
65 | * first; ecrtn.o must be linked last. Because these are wildcards, it |
---|
66 | * doesn't matter if the user does not actually link against ecrti.o and |
---|
67 | * ecrtn.o; the linker won't look for a file to match a wildcard. The |
---|
68 | * wildcard also means that it doesn't matter which directory ecrti.o |
---|
69 | * and ecrtn.o are in. |
---|
70 | */ |
---|
71 | PROVIDE (_init = .); |
---|
72 | *ecrti.o(.init) |
---|
73 | *(.init) |
---|
74 | *ecrtn.o(.init) |
---|
75 | |
---|
76 | PROVIDE (_fini = .); |
---|
77 | *ecrti.o(.fini) |
---|
78 | *(.fini) |
---|
79 | *ecrtn.o(.init) |
---|
80 | |
---|
81 | KEEP (*ecrti.o(.ctors)) |
---|
82 | KEEP (*crtbegin.o(.ctors)) |
---|
83 | KEEP (*crtbegin?.o(.ctors)) |
---|
84 | KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o *ecrtn.o) .ctors)) |
---|
85 | KEEP (*(SORT(.ctors.*))) |
---|
86 | KEEP (*(.ctors)) |
---|
87 | KEEP (*ecrti.o(.dtors)) |
---|
88 | KEEP (*crtbegin.o(.dtors)) |
---|
89 | KEEP (*crtbegin?.o(.dtors)) |
---|
90 | KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o *ecrtn.o) .dtors)) |
---|
91 | KEEP (*(SORT(.dtors.*))) |
---|
92 | KEEP (*(.dtors)) |
---|
93 | |
---|
94 | /* |
---|
95 | * Special FreeBSD sysctl sections. |
---|
96 | */ |
---|
97 | . = ALIGN (16); |
---|
98 | __start_set_sysctl_set = .; |
---|
99 | *(set_sysctl_*); |
---|
100 | __stop_set_sysctl_set = ABSOLUTE(.); |
---|
101 | *(set_domain_*); |
---|
102 | *(set_pseudo_*); |
---|
103 | |
---|
104 | /* Exception frame info */ |
---|
105 | *(.eh_frame) |
---|
106 | |
---|
107 | /* Miscellaneous read-only data */ |
---|
108 | _rodata_start = . ; |
---|
109 | *(.gnu.linkonce.r*) |
---|
110 | *(.lit) |
---|
111 | *(.shdata) |
---|
112 | *(.rodata*) |
---|
113 | *(.rodata1) |
---|
114 | KEEP (*(SORT(.rtemsroset.*))) |
---|
115 | *(.descriptors) |
---|
116 | *(rom_ver) |
---|
117 | _erodata = .; |
---|
118 | |
---|
119 | /* Various possible names for the end of the .text section */ |
---|
120 | etext = ALIGN(0x10); |
---|
121 | _etext = .; |
---|
122 | _endtext = .; |
---|
123 | text.end = .; |
---|
124 | PROVIDE (etext = .); |
---|
125 | PROVIDE (__etext = .); |
---|
126 | } |
---|
127 | text.size = text.end - text.start; |
---|
128 | |
---|
129 | .tdata : { |
---|
130 | _TLS_Data_begin = .; |
---|
131 | *(.tdata .tdata.* .gnu.linkonce.td.*) |
---|
132 | _TLS_Data_end = .; |
---|
133 | |
---|
134 | /* |
---|
135 | * .data section contents, copied to RAM at system startup. |
---|
136 | */ |
---|
137 | . = ALIGN(0x20); |
---|
138 | data.contents.start = .; |
---|
139 | } |
---|
140 | .tbss : { |
---|
141 | _TLS_BSS_begin = .; |
---|
142 | *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) |
---|
143 | _TLS_BSS_end = .; |
---|
144 | } |
---|
145 | _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin; |
---|
146 | _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin; |
---|
147 | _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin; |
---|
148 | _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin; |
---|
149 | _TLS_Size = _TLS_BSS_end - _TLS_Data_begin; |
---|
150 | _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss)); |
---|
151 | |
---|
152 | /* |
---|
153 | * If debugging, stack the read/write sections directly after the text |
---|
154 | * section. Otherwise, stack the read/write sections starting at base of |
---|
155 | * internal RAM. |
---|
156 | */ |
---|
157 | . = DEFINED(RTEMS_DEBUG) ? . : int_ram_org; |
---|
158 | |
---|
159 | .data : AT (data.contents.start) |
---|
160 | { |
---|
161 | data.start = .; |
---|
162 | |
---|
163 | *(.data) |
---|
164 | *(.data.*) |
---|
165 | KEEP (*(SORT(.rtemsrwset.*))) |
---|
166 | *(.data1) |
---|
167 | |
---|
168 | PROVIDE (__SDATA_START__ = .); |
---|
169 | *(.sdata .sdata.* .gnu.linkonce.s.*) |
---|
170 | PROVIDE (__SDATA_END__ = .); |
---|
171 | |
---|
172 | PROVIDE (__EXCEPT_START__ = .); |
---|
173 | *(.gcc_except_table*) |
---|
174 | PROVIDE (__EXCEPT_END__ = .); |
---|
175 | |
---|
176 | PROVIDE(__GOT_START__ = .); |
---|
177 | *(.got.plt) |
---|
178 | *(.got) |
---|
179 | PROVIDE(__GOT_END__ = .); |
---|
180 | |
---|
181 | *(.got1) |
---|
182 | |
---|
183 | PROVIDE (__GOT2_START__ = .); |
---|
184 | PROVIDE (_GOT2_START_ = .); |
---|
185 | *(.got2) |
---|
186 | PROVIDE (__GOT2_END__ = .); |
---|
187 | PROVIDE (_GOT2_END_ = .); |
---|
188 | |
---|
189 | PROVIDE (__FIXUP_START__ = .); |
---|
190 | PROVIDE (_FIXUP_START_ = .); |
---|
191 | *(.fixup) |
---|
192 | PROVIDE (_FIXUP_END_ = .); |
---|
193 | PROVIDE (__FIXUP_END__ = .); |
---|
194 | |
---|
195 | /* We want the small data sections together, so single-instruction |
---|
196 | * offsets can access them all. |
---|
197 | */ |
---|
198 | PROVIDE (__SDATA2_START__ = .); |
---|
199 | bsp_section_sdata_begin = .; |
---|
200 | *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) |
---|
201 | *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) |
---|
202 | PROVIDE (__SDATA2_END__ = .); |
---|
203 | bsp_section_sdata_end = .; |
---|
204 | |
---|
205 | data.end = .; |
---|
206 | } |
---|
207 | data.size = data.end - data.start; |
---|
208 | |
---|
209 | bss.start = .; |
---|
210 | .sbss : |
---|
211 | { |
---|
212 | PROVIDE (__sbss_start = .); PROVIDE (___sbss_start = .); |
---|
213 | bsp_section_sbss_begin = .; |
---|
214 | *(.dynsbss) |
---|
215 | *(.sbss .sbss.* .gnu.linkonce.sb.*) |
---|
216 | *(.scommon) |
---|
217 | PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .); |
---|
218 | bsp_section_sbss_end = .; |
---|
219 | bsp_section_sdata_libdl_begin = .; |
---|
220 | . = DEFINED(bsp_section_small_data_area_size) ? |
---|
221 | bsp_section_sdata_begin + bsp_section_small_data_area_size : .; |
---|
222 | bsp_section_sdata_libdl_end = .; |
---|
223 | } |
---|
224 | .bss : |
---|
225 | { |
---|
226 | *(.dynbss) |
---|
227 | *(.bss .bss* .gnu.linkonce.b*) |
---|
228 | *(COMMON) |
---|
229 | . = ALIGN(4); |
---|
230 | } |
---|
231 | bss.end = .; |
---|
232 | bss.size = bss.end - bss.start; |
---|
233 | |
---|
234 | PROVIDE(_end = bss.end); |
---|
235 | |
---|
236 | .rtemsstack (NOLOAD) : { |
---|
237 | *(SORT(.rtemsstack.*)) |
---|
238 | } |
---|
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 | } |
---|