source: rtems/bsps/powerpc/ss555/start/linkcmds @ e0dd8a5a

5
Last change on this file since e0dd8a5a was 9964895, checked in by Sebastian Huber <sebastian.huber@…>, on 04/20/18 at 08:35:35

bsps: Move startup files to bsps

Adjust build support files to new directory layout.

This patch is a part of the BSP source reorganization.

Update #3285.

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