source: rtems/bsps/powerpc/ss555/start/linkcmds @ 84e59b7c

Last change on this file since 84e59b7c was 84e59b7c, checked in by Sebastian Huber <sebastian.huber@…>, on Nov 15, 2018 at 7:47:22 PM

bsps/powerpc: Use interrupt stack for init stack

Move start.o to separate file.

Update #3459.

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