source: rtems/bsps/powerpc/ss555/start/linkcmds @ 90232bc

Last change on this file since 90232bc was ec1dd51a, checked in by Chris Johns <chrisj@…>, on Mar 6, 2019 at 10:15:56 AM

libdl: Add small data support to the remaining PowerPC BSPs.

Updates #3687

  • 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)
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    bsp_section_sdata_begin = .;
208    *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
209    *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
210    PROVIDE (__SDATA2_END__ = .);
211    bsp_section_sdata_end = .;
212
213    data.end = .;
214  }
215  data.size = data.end - data.start;
216
217  bss.start = .;
218  .sbss          :
219  {
220    PROVIDE (__sbss_start = .); PROVIDE (___sbss_start = .);
221    bsp_section_sbss_begin = .;
222    *(.dynsbss)
223    *(.sbss .sbss.* .gnu.linkonce.sb.*)
224    *(.scommon)
225    PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .);
226    bsp_section_sbss_end = .;
227    bsp_section_sdata_libdl_begin = .;
228    . = DEFINED(bsp_section_small_data_area_size) ?
229          bsp_section_sdata_begin + bsp_section_small_data_area_size : .;
230    bsp_section_sdata_libdl_end = .;
231  }
232  .bss :
233  {
234    *(.dynbss)
235    *(.bss .bss* .gnu.linkonce.b*)
236    *(COMMON)
237    . = ALIGN(4);
238  }
239  bss.end = .;
240  bss.size = bss.end - bss.start;
241
242  PROVIDE(_end = bss.end);
243
244  .rtemsstack (NOLOAD) : {
245    *(SORT(.rtemsstack.*))
246  }
247
248  /*
249   * Work Area
250   *
251   * The Work Area is configured at run-time to use all available memory.  It
252   * begins just after the end of the Workspace and continues to the end of
253   * the external RAM.
254   */
255  . = DEFINED(RTEMS_DEBUG) ? 0 + ext_ram_size : int_ram_top + ext_ram_size;
256  WorkAreaBase = .;
257
258
259  /*
260   * Internal I/O devices
261   */
262  .usiu 0x002FC000:             /* unified system interface unit */
263  {
264    usiu = .;
265  }
266
267  .imb 0x00300000:              /* inter-module bus and devices */
268  {
269    imb = .;
270  }
271
272  .sram 0x00380000:             /* internal SRAM control registers */
273  {
274    sram = .;
275  }
276
277  /*
278   * SS555 external devices managed by on-board CPLD
279   */
280  .cpld 0xFF000000:             /* SS555 external CPLD devices */
281  {
282    cpld = .;
283  }
284
285
286  /* Stabs debugging sections.  */
287  .stab 0 : { *(.stab) }
288  .stabstr 0 : { *(.stabstr) }
289  .stab.excl 0 : { *(.stab.excl) }
290  .stab.exclstr 0 : { *(.stab.exclstr) }
291  .stab.index 0 : { *(.stab.index) }
292  .stab.indexstr 0 : { *(.stab.indexstr) }
293  .comment 0 : { *(.comment) }
294
295  /* DWARF debug sections.
296     Symbols in the DWARF debugging sections are relative to the beginning
297     of the section so we begin them at 0.  */
298  /* DWARF 1 */
299  .debug          0 : { *(.debug) }
300  .line           0 : { *(.line) }
301
302  /* GNU DWARF 1 extensions */
303  .debug_srcinfo  0 : { *(.debug_srcinfo) }
304  .debug_sfnames  0 : { *(.debug_sfnames) }
305
306  /* DWARF 1.1 and DWARF 2 */
307  .debug_aranges  0 : { *(.debug_aranges) }
308  .debug_pubnames 0 : { *(.debug_pubnames) }
309
310  /* DWARF 2 */
311  .debug_info     0 : { *(.debug_info) }
312  .debug_abbrev   0 : { *(.debug_abbrev) }
313  .debug_line     0 : { *(.debug_line) }
314  .debug_frame    0 : { *(.debug_frame) }
315  .debug_str      0 : { *(.debug_str) }
316  .debug_loc      0 : { *(.debug_loc) }
317  .debug_macinfo  0 : { *(.debug_macinfo) }
318
319  /* SGI/MIPS DWARF 2 extensions */
320  .debug_weaknames 0 : { *(.debug_weaknames) }
321  .debug_funcnames 0 : { *(.debug_funcnames) }
322  .debug_typenames 0 : { *(.debug_typenames) }
323  .debug_varnames  0 : { *(.debug_varnames) }
324  /* These must appear regardless of  .  */
325}
Note: See TracBrowser for help on using the repository browser.