source: rtems/c/src/lib/libbsp/powerpc/shared/startup/linkcmds.base @ f33d3b4

5
Last change on this file since f33d3b4 was f33d3b4, checked in by Joel Sherrill <joel@…>, on 12/20/17 at 17:36:13

gen5200, gen83xx, gen83x, mpc55xxevb, psim, qoriq, t32mppc, tqm8xx, virtex: Simplify bsp_specs

These BSPs all use shared/startup/linkcmds.base and thus needed to be
modified at the same time. Variations in the arguments were reflected
into the BSP specific portions of the linkcmds.

Updates #3520.

  • Property mode set to 100644
File size: 14.7 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup bsp_linker
5 *
6 * @brief Linker command base file.
7 */
8
9/*
10 * Copyright (c) 2011, 2016 embedded brains GmbH.  All rights reserved.
11 *
12 *  embedded brains GmbH
13 *  Dornierstr. 4
14 *  82178 Puchheim
15 *  Germany
16 *  <rtems@embedded-brains.de>
17 *
18 * The license and distribution terms for this file may be
19 * found in the file LICENSE in this distribution or at
20 * http://www.rtems.org/license/LICENSE.
21 */
22
23ENTRY (_start)
24STARTUP (start.o)
25
26/*
27 * Global symbols that may be defined externally
28 */
29
30bsp_section_xbarrier_align = DEFINED (bsp_section_xbarrier_align) ? bsp_section_xbarrier_align : 1;
31bsp_section_robarrier_align = DEFINED (bsp_section_robarrier_align) ? bsp_section_robarrier_align : 1;
32bsp_section_rwbarrier_align = DEFINED (bsp_section_rwbarrier_align) ? bsp_section_rwbarrier_align : 1;
33
34MEMORY {
35        UNEXPECTED_SECTIONS : ORIGIN = 0xffffffff, LENGTH = 0
36}
37
38SECTIONS {
39        .start : ALIGN_WITH_INPUT {
40                bsp_section_start_begin = .;
41                KEEP (*(.bsp_start_text))
42                KEEP (*(.bsp_start_data))
43                bsp_section_start_end = .;
44        } > REGION_START AT > REGION_START
45        bsp_section_start_size = bsp_section_start_end - bsp_section_start_begin;
46
47        .xbarrier : ALIGN_WITH_INPUT {
48                . = ALIGN (bsp_section_xbarrier_align);
49        } > REGION_TEXT AT > REGION_TEXT
50
51        .text : ALIGN_WITH_INPUT {
52                bsp_section_text_begin = .;
53                *(SORT(.bsp_text*))
54                *(.text.unlikely .text.*_unlikely)
55                *(.text .stub .text.* .gnu.linkonce.t.*)
56                *(.gnu.warning)
57                *(.sfpr .glink)
58        } > REGION_TEXT AT > REGION_TEXT_LOAD
59        .init : ALIGN_WITH_INPUT {
60                KEEP (*(.init))
61        } > REGION_TEXT AT > REGION_TEXT_LOAD
62        .fini : ALIGN_WITH_INPUT {
63                PROVIDE (_fini = .);
64                KEEP (*(.fini))
65                bsp_section_text_end = .;
66        } > REGION_TEXT AT > REGION_TEXT_LOAD
67        bsp_section_text_size = bsp_section_text_end - bsp_section_text_begin;
68        bsp_section_text_load_begin = LOADADDR (.text);
69        bsp_section_text_load_end = bsp_section_text_load_begin + bsp_section_text_size;
70
71        .fast_text : ALIGN_WITH_INPUT {
72                bsp_section_fast_text_begin = .;
73                *(.bsp_fast_text)
74                bsp_section_fast_text_end = .;
75        } > REGION_FAST_TEXT AT > REGION_FAST_TEXT_LOAD
76        bsp_section_fast_text_size = bsp_section_fast_text_end - bsp_section_fast_text_begin;
77        bsp_section_fast_text_load_begin = LOADADDR (.fast_text);
78        bsp_section_fast_text_load_end = bsp_section_fast_text_load_begin + bsp_section_fast_text_size;
79
80        .robarrier : ALIGN_WITH_INPUT {
81                . = ALIGN (bsp_section_robarrier_align);
82        } > REGION_RODATA AT > REGION_RODATA
83
84        .rodata : ALIGN_WITH_INPUT {
85                bsp_section_rodata_begin = .;
86                *(SORT(.bsp_rodata*))
87                *(.rodata .rodata.* .gnu.linkonce.r.*)
88        } > REGION_RODATA AT > REGION_RODATA_LOAD
89        .rodata1 : ALIGN_WITH_INPUT {
90                *(.rodata1)
91        } > REGION_RODATA AT > REGION_RODATA_LOAD
92        .sdata2 : ALIGN_WITH_INPUT {
93                PROVIDE (_SDA2_BASE_ = 32768);
94                *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
95        } > REGION_RODATA AT > REGION_RODATA_LOAD
96        .sbss2 : ALIGN_WITH_INPUT {
97                *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
98        } > REGION_RODATA AT > REGION_RODATA_LOAD
99        .eh_frame_hdr : ALIGN_WITH_INPUT {
100                *(.eh_frame_hdr)
101        } > REGION_RODATA AT > REGION_RODATA_LOAD
102        .eh_frame : ALIGN_WITH_INPUT {
103                KEEP (*(.eh_frame))
104        } > REGION_RODATA AT > REGION_RODATA_LOAD
105        .gcc_except_table : ALIGN_WITH_INPUT {
106                *(.gcc_except_table .gcc_except_table.*)
107        } > REGION_RODATA AT > REGION_RODATA_LOAD
108        .tdata : ALIGN_WITH_INPUT {
109                _TLS_Data_begin = .;
110                *(.tdata .tdata.* .gnu.linkonce.td.*)
111                _TLS_Data_end = .;
112        } > REGION_RODATA AT > REGION_RODATA_LOAD
113        .tbss : ALIGN_WITH_INPUT {
114                _TLS_BSS_begin = .;
115                *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
116                _TLS_BSS_end = .;
117        } > REGION_RODATA AT > REGION_RODATA_LOAD
118        _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
119        _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
120        _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
121        _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
122        _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
123        _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
124        .preinit_array : ALIGN_WITH_INPUT {
125                PROVIDE_HIDDEN (__preinit_array_start = .);
126                KEEP (*(.preinit_array))
127                PROVIDE_HIDDEN (__preinit_array_end = .);
128        } > REGION_RODATA AT > REGION_RODATA_LOAD
129        .init_array : ALIGN_WITH_INPUT {
130                PROVIDE_HIDDEN (__init_array_start = .);
131                KEEP (*(SORT(.init_array.*)))
132                KEEP (*(.init_array))
133                PROVIDE_HIDDEN (__init_array_end = .);
134        } > REGION_RODATA AT > REGION_RODATA_LOAD
135        .fini_array : ALIGN_WITH_INPUT {
136                PROVIDE_HIDDEN (__fini_array_start = .);
137                KEEP (*(SORT(.fini_array.*)))
138                KEEP (*(.fini_array))
139                PROVIDE_HIDDEN (__fini_array_end = .);
140        } > REGION_RODATA AT > REGION_RODATA_LOAD
141        .ctors : ALIGN_WITH_INPUT {
142                KEEP (*crtbegin.o(.ctors))
143                KEEP (*crtbegin?.o(.ctors))
144                KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
145                KEEP (*(SORT(.ctors.*)))
146                KEEP (*(.ctors))
147        } > REGION_RODATA AT > REGION_RODATA_LOAD
148        .dtors : ALIGN_WITH_INPUT {
149                KEEP (*crtbegin.o(.dtors))
150                KEEP (*crtbegin?.o(.dtors))
151                KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
152                KEEP (*(SORT(.dtors.*)))
153                KEEP (*(.dtors))
154        } > REGION_RODATA AT > REGION_RODATA_LOAD
155        .jcr : ALIGN_WITH_INPUT {
156                KEEP (*(.jcr))
157        } > REGION_RODATA AT > REGION_RODATA_LOAD
158        .data.rel.ro : ALIGN_WITH_INPUT {
159                *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*)
160        } > REGION_RODATA AT > REGION_RODATA_LOAD
161        .fixup : ALIGN_WITH_INPUT {
162                *(.fixup)
163        } > REGION_RODATA AT > REGION_RODATA_LOAD
164        .dynamic : ALIGN_WITH_INPUT {
165                *(.dynamic)
166        } > REGION_RODATA AT > REGION_RODATA_LOAD
167        .opd : ALIGN_WITH_INPUT {
168                KEEP (*(.opd))
169        } > REGION_RODATA AT > REGION_RODATA_LOAD
170        .tm_clone_table : ALIGN_WITH_INPUT {
171                *(.tm_clone_table)
172        } > REGION_RODATA AT > REGION_RODATA_LOAD
173        .toc1 : ALIGN_WITH_INPUT {
174                *(.toc1)
175        } > REGION_RODATA AT > REGION_RODATA_LOAD
176        .branch_lt : ALIGN_WITH_INPUT {
177                *(.branch_lt)
178        } > REGION_RODATA AT > REGION_RODATA_LOAD
179        .got1 : ALIGN_WITH_INPUT {
180                *(.got1)
181        } > REGION_RODATA AT > REGION_RODATA_LOAD
182        .got2 : ALIGN_WITH_INPUT {
183                *(.got2)
184        } > REGION_RODATA AT > REGION_RODATA_LOAD
185        .got : ALIGN_WITH_INPUT {
186                *(.got)
187        } > REGION_RODATA AT > REGION_RODATA_LOAD
188        .toc : ALIGN_WITH_INPUT {
189                *(.toc)
190        } > REGION_RODATA AT > REGION_RODATA_LOAD
191        .plt : ALIGN_WITH_INPUT {
192                *(.plt)
193        } > REGION_RODATA AT > REGION_RODATA_LOAD
194        .iplt : ALIGN_WITH_INPUT {
195                *(.iplt)
196        } > REGION_RODATA AT > REGION_RODATA_LOAD
197        .interp : ALIGN_WITH_INPUT {
198                *(.interp)
199        } > REGION_RODATA AT > REGION_RODATA_LOAD
200        .note.gnu.build-id : ALIGN_WITH_INPUT {
201                *(.note.gnu.build-id)
202        } > REGION_RODATA AT > REGION_RODATA_LOAD
203        .hash : ALIGN_WITH_INPUT {
204                *(.hash)
205        } > REGION_RODATA AT > REGION_RODATA_LOAD
206        .gnu.hash : ALIGN_WITH_INPUT {
207                *(.gnu.hash)
208        } > REGION_RODATA AT > REGION_RODATA_LOAD
209        .dynsym : ALIGN_WITH_INPUT {
210                *(.dynsym)
211        } > REGION_RODATA AT > REGION_RODATA_LOAD
212        .dynstr : ALIGN_WITH_INPUT {
213                *(.dynstr)
214        } > REGION_RODATA AT > REGION_RODATA_LOAD
215        .gnu.version : ALIGN_WITH_INPUT {
216                *(.gnu.version)
217        } > REGION_RODATA AT > REGION_RODATA_LOAD
218        .gnu.version_d : ALIGN_WITH_INPUT {
219                *(.gnu.version_d)
220        } > REGION_RODATA AT > REGION_RODATA_LOAD
221        .gnu.version_r : ALIGN_WITH_INPUT {
222                *(.gnu.version_r)
223        } > REGION_RODATA AT > REGION_RODATA_LOAD
224        .rela.dyn : ALIGN_WITH_INPUT {
225                *(.rela.init)
226                *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
227                *(.rela.fini)
228                *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
229                *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
230                *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
231                *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
232                *(.rela.ctors)
233                *(.rela.dtors)
234                *(.rela.got)
235                *(.rela.got1)
236                *(.rela.got2)
237                *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
238                *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
239                *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
240                *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
241                *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
242                *(.rela.rtemsroset*)
243                *(.rela.rtemsrwset*)
244                PROVIDE_HIDDEN (__rel_iplt_start = .);
245                PROVIDE_HIDDEN (__rel_iplt_end = .);
246                PROVIDE_HIDDEN (__rela_iplt_start = .);
247                *(.rela.iplt)
248                PROVIDE_HIDDEN (__rela_iplt_end = .);
249        } > REGION_RODATA AT > REGION_RODATA_LOAD
250        .rela.plt : ALIGN_WITH_INPUT {
251                *(.rela.plt)
252        } > REGION_RODATA AT > REGION_RODATA_LOAD
253        .rtemsroset : ALIGN_WITH_INPUT {
254                /* Special FreeBSD linker set sections */
255                __start_set_sysctl_set = .;
256                *(set_sysctl_*);
257                __stop_set_sysctl_set = .;
258                *(set_domain_*);
259                *(set_pseudo_*);
260
261                KEEP (*(SORT(.rtemsroset.*)))
262                bsp_section_rodata_end = .;
263        } > REGION_RODATA AT > REGION_RODATA_LOAD
264        bsp_section_rodata_size = bsp_section_rodata_end - bsp_section_rodata_begin;
265        bsp_section_rodata_load_begin = LOADADDR (.rodata);
266        bsp_section_rodata_load_end = bsp_section_rodata_load_begin + bsp_section_rodata_size;
267
268        .rwbarrier : ALIGN_WITH_INPUT {
269                . = ALIGN (bsp_section_rwbarrier_align);
270        } > REGION_DATA AT > REGION_DATA
271
272        .fast_data : ALIGN_WITH_INPUT {
273                bsp_section_fast_data_begin = .;
274                *(SORT(.bsp_fast_data*))
275                bsp_section_fast_data_end = .;
276        } > REGION_FAST_DATA AT > REGION_FAST_DATA_LOAD
277        bsp_section_fast_data_size = bsp_section_fast_data_end - bsp_section_fast_data_begin;
278        bsp_section_fast_data_load_begin = LOADADDR (.fast_data);
279        bsp_section_fast_data_load_end = bsp_section_fast_data_load_begin + bsp_section_fast_data_size;
280
281        .data : ALIGN_WITH_INPUT {
282                bsp_section_data_begin = .;
283                *(SORT(.bsp_data*))
284                *(.data .data.* .gnu.linkonce.d.*)
285                SORT(CONSTRUCTORS)
286        } > REGION_DATA AT > REGION_DATA_LOAD
287        .data1 : ALIGN_WITH_INPUT {
288                *(.data1)
289        } > REGION_DATA AT > REGION_DATA_LOAD
290        .rtemsrwset : ALIGN_WITH_INPUT {
291                KEEP (*(SORT(.rtemsrwset.*)))
292        } > REGION_DATA AT > REGION_DATA_LOAD
293        .sdata : ALIGN_WITH_INPUT {
294                PROVIDE (_SDA_BASE_ = 32768);
295                *(.sdata .sdata.* .gnu.linkonce.s.*)
296                bsp_section_data_end = .;
297        } > REGION_DATA AT > REGION_DATA_LOAD
298        bsp_section_data_size = bsp_section_data_end - bsp_section_data_begin;
299        bsp_section_data_load_begin = LOADADDR (.data);
300        bsp_section_data_load_end = bsp_section_data_load_begin + bsp_section_data_size;
301
302        .sbss : ALIGN_WITH_INPUT {
303                bsp_section_sbss_begin = .;
304                *(.dynsbss)
305                *(.sbss .sbss.* .gnu.linkonce.sb.*)
306                *(.scommon)
307                bsp_section_sbss_end = .;
308        } > REGION_DATA AT > REGION_DATA
309        bsp_section_sbss_size = bsp_section_sbss_end - bsp_section_sbss_begin;
310
311        .bss : ALIGN_WITH_INPUT {
312                bsp_section_bss_begin = .;
313                *(.dynbss)
314                *(.bss .bss.* .gnu.linkonce.b.*)
315                *(COMMON)
316                bsp_section_bss_end = .;
317        } > REGION_BSS AT > REGION_BSS
318        bsp_section_bss_size = bsp_section_bss_end - bsp_section_bss_begin;
319
320        .rwextra : ALIGN_WITH_INPUT {
321                bsp_section_rwextra_begin = .;
322                *(.bsp_rwextra)
323                bsp_section_rwextra_end = .;
324        } > REGION_RWEXTRA AT > REGION_RWEXTRA
325        bsp_section_rwextra_size = bsp_section_rwextra_end - bsp_section_rwextra_begin;
326
327        .work : ALIGN_WITH_INPUT {
328                /*
329                 * The work section will occupy the remaining REGION_WORK region and
330                 * contains the RTEMS work space and heap.
331                 */
332                bsp_section_work_begin = .;
333                . += ORIGIN (REGION_WORK) + LENGTH (REGION_WORK) - ABSOLUTE (.);
334                bsp_section_work_end = .;
335        } > REGION_WORK AT > REGION_WORK
336        bsp_section_work_size = bsp_section_work_end - bsp_section_work_begin;
337
338        .stack : ALIGN_WITH_INPUT {
339                /*
340                 * The stack section will occupy the remaining REGION_STACK region and may
341                 * contain the task stacks.  Depending on the region distribution this
342                 * section may be of zero size.
343                 */
344                bsp_section_stack_begin = .;
345                . += ORIGIN (REGION_STACK) + LENGTH (REGION_STACK) - ABSOLUTE (.);
346                bsp_section_stack_end = .;
347        } > REGION_STACK AT > REGION_STACK
348        bsp_section_stack_size = bsp_section_stack_end - bsp_section_stack_begin;
349
350        .nocache : ALIGN_WITH_INPUT {
351                bsp_section_nocache_begin = .;
352                *(SORT_BY_ALIGNMENT (SORT_BY_NAME (.bsp_nocache*)))
353                bsp_section_nocache_end = .;
354        } > REGION_NOCACHE AT > REGION_NOCACHE_LOAD
355        bsp_section_nocache_size = bsp_section_nocache_end - bsp_section_nocache_begin;
356        bsp_section_nocache_load_begin = LOADADDR (.nocache);
357        bsp_section_nocache_load_end = bsp_section_nocache_load_begin + bsp_section_nocache_size;
358
359        .nocachenoload (NOLOAD) : ALIGN_WITH_INPUT {
360                bsp_section_nocachenoload_begin = .;
361                *(SORT_BY_ALIGNMENT (SORT_BY_NAME (.bsp_noload_nocache*)))
362                bsp_section_nocacheheap_begin = .;
363                . += ORIGIN (REGION_NOCACHE) + LENGTH (REGION_NOCACHE) - ABSOLUTE (.);
364                bsp_section_nocacheheap_end = .;
365                bsp_section_nocachenoload_end = .;
366        } > REGION_NOCACHE AT > REGION_NOCACHE
367        bsp_section_nocacheheap_size = bsp_section_nocacheheap_end - bsp_section_nocacheheap_begin;
368        bsp_section_nocachenoload_size = bsp_section_nocachenoload_end - bsp_section_nocachenoload_begin;
369
370        .nvram (NOLOAD) : ALIGN_WITH_INPUT {
371                bsp_section_nvram_begin = .;
372                *(SORT_BY_ALIGNMENT (SORT_BY_NAME (.bsp_nvram*)))
373                bsp_section_nvram_end = .;
374        } > REGION_NVRAM AT > REGION_NVRAM
375        bsp_section_nvram_size = bsp_section_nvram_end - bsp_section_nvram_begin;
376
377        /* FIXME */
378        RamBase = ORIGIN (REGION_WORK);
379        RamSize = LENGTH (REGION_WORK);
380        WorkAreaBase = bsp_section_work_begin;
381        HeapSize = 0;
382
383        /* Stabs debugging sections.  */
384        .stab          0 : { *(.stab) }
385        .stabstr       0 : { *(.stabstr) }
386        .stab.excl     0 : { *(.stab.excl) }
387        .stab.exclstr  0 : { *(.stab.exclstr) }
388        .stab.index    0 : { *(.stab.index) }
389        .stab.indexstr 0 : { *(.stab.indexstr) }
390        .comment       0 : { *(.comment) }
391        /* DWARF debug sections.
392           Symbols in the DWARF debugging sections are relative to the beginning
393           of the section so we begin them at 0.  */
394        /* DWARF 1 */
395        .debug          0 : { *(.debug) }
396        .line           0 : { *(.line) }
397        /* GNU DWARF 1 extensions */
398        .debug_srcinfo  0 : { *(.debug_srcinfo) }
399        .debug_sfnames  0 : { *(.debug_sfnames) }
400        /* DWARF 1.1 and DWARF 2 */
401        .debug_aranges  0 : { *(.debug_aranges) }
402        .debug_pubnames 0 : { *(.debug_pubnames) }
403        /* DWARF 2 */
404        .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
405        .debug_abbrev   0 : { *(.debug_abbrev) }
406        .debug_line     0 : { *(.debug_line .debug_line.* .debug_line_end ) }
407        .debug_frame    0 : { *(.debug_frame) }
408        .debug_str      0 : { *(.debug_str) }
409        .debug_loc      0 : { *(.debug_loc) }
410        .debug_macinfo  0 : { *(.debug_macinfo) }
411        /* SGI/MIPS DWARF 2 extensions */
412        .debug_weaknames 0 : { *(.debug_weaknames) }
413        .debug_funcnames 0 : { *(.debug_funcnames) }
414        .debug_typenames 0 : { *(.debug_typenames) }
415        .debug_varnames  0 : { *(.debug_varnames) }
416        /* DWARF 3 */
417        .debug_pubtypes 0 : { *(.debug_pubtypes) }
418        .debug_ranges   0 : { *(.debug_ranges) }
419        /* DWARF Extension.  */
420        .debug_macro    0 : { *(.debug_macro) }
421        .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
422        .PPC.EMB.apuinfo 0 : { *(.PPC.EMB.apuinfo) }
423        /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
424
425        /*
426         * This is a RTEMS specific section to catch all unexpected input
427         * sections.  In case you get an error like
428         *   "section `.unexpected_sections' will not fit in region
429         *   `UNEXPECTED_SECTIONS'"
430         * you have to figure out the offending input section and add it to the
431         * appropriate output section definition above.
432         */
433        .unexpected_sections : { *(*) } > UNEXPECTED_SECTIONS
434}
Note: See TracBrowser for help on using the repository browser.