source: rtems/bsps/powerpc/shared/start/linkcmds.base @ 9964895

5
Last change on this file since 9964895 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: 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 (*ecrti.o(.ctors))
143                KEEP (*crtbegin.o(.ctors))
144                KEEP (*crtbegin?.o(.ctors))
145                KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o *ecrtn.o) .ctors))
146                KEEP (*(SORT(.ctors.*)))
147                KEEP (*(.ctors))
148        } > REGION_RODATA AT > REGION_RODATA_LOAD
149        .dtors : ALIGN_WITH_INPUT {
150                KEEP (*ecrti.o(.dtors))
151                KEEP (*crtbegin.o(.dtors))
152                KEEP (*crtbegin?.o(.dtors))
153                KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o *ecrtn.o) .dtors))
154                KEEP (*(SORT(.dtors.*)))
155                KEEP (*(.dtors))
156        } > REGION_RODATA AT > REGION_RODATA_LOAD
157        .jcr : ALIGN_WITH_INPUT {
158                KEEP (*(.jcr))
159        } > REGION_RODATA AT > REGION_RODATA_LOAD
160        .data.rel.ro : ALIGN_WITH_INPUT {
161                *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*)
162        } > REGION_RODATA AT > REGION_RODATA_LOAD
163        .fixup : ALIGN_WITH_INPUT {
164                *(.fixup)
165        } > REGION_RODATA AT > REGION_RODATA_LOAD
166        .dynamic : ALIGN_WITH_INPUT {
167                *(.dynamic)
168        } > REGION_RODATA AT > REGION_RODATA_LOAD
169        .opd : ALIGN_WITH_INPUT {
170                KEEP (*(.opd))
171        } > REGION_RODATA AT > REGION_RODATA_LOAD
172        .tm_clone_table : ALIGN_WITH_INPUT {
173                *(.tm_clone_table)
174        } > REGION_RODATA AT > REGION_RODATA_LOAD
175        .toc1 : ALIGN_WITH_INPUT {
176                *(.toc1)
177        } > REGION_RODATA AT > REGION_RODATA_LOAD
178        .branch_lt : ALIGN_WITH_INPUT {
179                *(.branch_lt)
180        } > REGION_RODATA AT > REGION_RODATA_LOAD
181        .got1 : ALIGN_WITH_INPUT {
182                *(.got1)
183        } > REGION_RODATA AT > REGION_RODATA_LOAD
184        .got2 : ALIGN_WITH_INPUT {
185                *(.got2)
186        } > REGION_RODATA AT > REGION_RODATA_LOAD
187        .got : ALIGN_WITH_INPUT {
188                *(.got)
189        } > REGION_RODATA AT > REGION_RODATA_LOAD
190        .toc : ALIGN_WITH_INPUT {
191                *(.toc)
192        } > REGION_RODATA AT > REGION_RODATA_LOAD
193        .plt : ALIGN_WITH_INPUT {
194                *(.plt)
195        } > REGION_RODATA AT > REGION_RODATA_LOAD
196        .iplt : ALIGN_WITH_INPUT {
197                *(.iplt)
198        } > REGION_RODATA AT > REGION_RODATA_LOAD
199        .interp : ALIGN_WITH_INPUT {
200                *(.interp)
201        } > REGION_RODATA AT > REGION_RODATA_LOAD
202        .note.gnu.build-id : ALIGN_WITH_INPUT {
203                *(.note.gnu.build-id)
204        } > REGION_RODATA AT > REGION_RODATA_LOAD
205        .hash : ALIGN_WITH_INPUT {
206                *(.hash)
207        } > REGION_RODATA AT > REGION_RODATA_LOAD
208        .gnu.hash : ALIGN_WITH_INPUT {
209                *(.gnu.hash)
210        } > REGION_RODATA AT > REGION_RODATA_LOAD
211        .dynsym : ALIGN_WITH_INPUT {
212                *(.dynsym)
213        } > REGION_RODATA AT > REGION_RODATA_LOAD
214        .dynstr : ALIGN_WITH_INPUT {
215                *(.dynstr)
216        } > REGION_RODATA AT > REGION_RODATA_LOAD
217        .gnu.version : ALIGN_WITH_INPUT {
218                *(.gnu.version)
219        } > REGION_RODATA AT > REGION_RODATA_LOAD
220        .gnu.version_d : ALIGN_WITH_INPUT {
221                *(.gnu.version_d)
222        } > REGION_RODATA AT > REGION_RODATA_LOAD
223        .gnu.version_r : ALIGN_WITH_INPUT {
224                *(.gnu.version_r)
225        } > REGION_RODATA AT > REGION_RODATA_LOAD
226        .rela.dyn : ALIGN_WITH_INPUT {
227                *(.rela.init)
228                *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
229                *(.rela.fini)
230                *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
231                *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
232                *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
233                *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
234                *(.rela.ctors)
235                *(.rela.dtors)
236                *(.rela.got)
237                *(.rela.got1)
238                *(.rela.got2)
239                *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
240                *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
241                *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
242                *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
243                *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
244                *(.rela.rtemsroset*)
245                *(.rela.rtemsrwset*)
246                PROVIDE_HIDDEN (__rel_iplt_start = .);
247                PROVIDE_HIDDEN (__rel_iplt_end = .);
248                PROVIDE_HIDDEN (__rela_iplt_start = .);
249                *(.rela.iplt)
250                PROVIDE_HIDDEN (__rela_iplt_end = .);
251        } > REGION_RODATA AT > REGION_RODATA_LOAD
252        .rela.plt : ALIGN_WITH_INPUT {
253                *(.rela.plt)
254        } > REGION_RODATA AT > REGION_RODATA_LOAD
255        .rtemsroset : ALIGN_WITH_INPUT {
256                /* Special FreeBSD linker set sections */
257                __start_set_sysctl_set = .;
258                *(set_sysctl_*);
259                __stop_set_sysctl_set = .;
260                *(set_domain_*);
261                *(set_pseudo_*);
262
263                KEEP (*(SORT(*.rtemsroset.*)))
264                bsp_section_rodata_end = .;
265        } > REGION_RODATA AT > REGION_RODATA_LOAD
266        bsp_section_rodata_size = bsp_section_rodata_end - bsp_section_rodata_begin;
267        bsp_section_rodata_load_begin = LOADADDR (.rodata);
268        bsp_section_rodata_load_end = bsp_section_rodata_load_begin + bsp_section_rodata_size;
269
270        .rwbarrier : ALIGN_WITH_INPUT {
271                . = ALIGN (bsp_section_rwbarrier_align);
272        } > REGION_DATA AT > REGION_DATA
273
274        .fast_data : ALIGN_WITH_INPUT {
275                bsp_section_fast_data_begin = .;
276                *(SORT(.bsp_fast_data*))
277                bsp_section_fast_data_end = .;
278        } > REGION_FAST_DATA AT > REGION_FAST_DATA_LOAD
279        bsp_section_fast_data_size = bsp_section_fast_data_end - bsp_section_fast_data_begin;
280        bsp_section_fast_data_load_begin = LOADADDR (.fast_data);
281        bsp_section_fast_data_load_end = bsp_section_fast_data_load_begin + bsp_section_fast_data_size;
282
283        .data : ALIGN_WITH_INPUT {
284                bsp_section_data_begin = .;
285                *(SORT(.bsp_data*))
286                *(.data .data.* .gnu.linkonce.d.*)
287                SORT(CONSTRUCTORS)
288        } > REGION_DATA AT > REGION_DATA_LOAD
289        .data1 : ALIGN_WITH_INPUT {
290                *(.data1)
291        } > REGION_DATA AT > REGION_DATA_LOAD
292        .rtemsrwset : ALIGN_WITH_INPUT {
293                KEEP (*(SORT(.rtemsrwset.*)))
294        } > REGION_DATA AT > REGION_DATA_LOAD
295        .sdata : ALIGN_WITH_INPUT {
296                PROVIDE (_SDA_BASE_ = 32768);
297                *(.sdata .sdata.* .gnu.linkonce.s.*)
298                bsp_section_data_end = .;
299        } > REGION_DATA AT > REGION_DATA_LOAD
300        bsp_section_data_size = bsp_section_data_end - bsp_section_data_begin;
301        bsp_section_data_load_begin = LOADADDR (.data);
302        bsp_section_data_load_end = bsp_section_data_load_begin + bsp_section_data_size;
303
304        .sbss : ALIGN_WITH_INPUT {
305                bsp_section_sbss_begin = .;
306                *(.dynsbss)
307                *(.sbss .sbss.* .gnu.linkonce.sb.*)
308                *(.scommon)
309                bsp_section_sbss_end = .;
310        } > REGION_DATA AT > REGION_DATA
311        bsp_section_sbss_size = bsp_section_sbss_end - bsp_section_sbss_begin;
312
313        .bss : ALIGN_WITH_INPUT {
314                bsp_section_bss_begin = .;
315                *(.dynbss)
316                *(.bss .bss.* .gnu.linkonce.b.*)
317                *(COMMON)
318                bsp_section_bss_end = .;
319        } > REGION_BSS AT > REGION_BSS
320        bsp_section_bss_size = bsp_section_bss_end - bsp_section_bss_begin;
321
322        .rwextra : ALIGN_WITH_INPUT {
323                bsp_section_rwextra_begin = .;
324                *(.bsp_rwextra)
325                bsp_section_rwextra_end = .;
326        } > REGION_RWEXTRA AT > REGION_RWEXTRA
327        bsp_section_rwextra_size = bsp_section_rwextra_end - bsp_section_rwextra_begin;
328
329        .work : ALIGN_WITH_INPUT {
330                /*
331                 * The work section will occupy the remaining REGION_WORK region and
332                 * contains the RTEMS work space and heap.
333                 */
334                bsp_section_work_begin = .;
335                . += ORIGIN (REGION_WORK) + LENGTH (REGION_WORK) - ABSOLUTE (.);
336                bsp_section_work_end = .;
337        } > REGION_WORK AT > REGION_WORK
338        bsp_section_work_size = bsp_section_work_end - bsp_section_work_begin;
339
340        .stack : ALIGN_WITH_INPUT {
341                /*
342                 * The stack section will occupy the remaining REGION_STACK region and may
343                 * contain the task stacks.  Depending on the region distribution this
344                 * section may be of zero size.
345                 */
346                bsp_section_stack_begin = .;
347                . += ORIGIN (REGION_STACK) + LENGTH (REGION_STACK) - ABSOLUTE (.);
348                bsp_section_stack_end = .;
349        } > REGION_STACK AT > REGION_STACK
350        bsp_section_stack_size = bsp_section_stack_end - bsp_section_stack_begin;
351
352        .nocache : ALIGN_WITH_INPUT {
353                bsp_section_nocache_begin = .;
354                *(SORT_BY_ALIGNMENT (SORT_BY_NAME (.bsp_nocache*)))
355                bsp_section_nocache_end = .;
356        } > REGION_NOCACHE AT > REGION_NOCACHE_LOAD
357        bsp_section_nocache_size = bsp_section_nocache_end - bsp_section_nocache_begin;
358        bsp_section_nocache_load_begin = LOADADDR (.nocache);
359        bsp_section_nocache_load_end = bsp_section_nocache_load_begin + bsp_section_nocache_size;
360
361        .nocachenoload (NOLOAD) : ALIGN_WITH_INPUT {
362                bsp_section_nocachenoload_begin = .;
363                *(SORT_BY_ALIGNMENT (SORT_BY_NAME (.bsp_noload_nocache*)))
364                bsp_section_nocacheheap_begin = .;
365                . += ORIGIN (REGION_NOCACHE) + LENGTH (REGION_NOCACHE) - ABSOLUTE (.);
366                bsp_section_nocacheheap_end = .;
367                bsp_section_nocachenoload_end = .;
368        } > REGION_NOCACHE AT > REGION_NOCACHE
369        bsp_section_nocacheheap_size = bsp_section_nocacheheap_end - bsp_section_nocacheheap_begin;
370        bsp_section_nocachenoload_size = bsp_section_nocachenoload_end - bsp_section_nocachenoload_begin;
371
372        .nvram (NOLOAD) : ALIGN_WITH_INPUT {
373                bsp_section_nvram_begin = .;
374                *(SORT_BY_ALIGNMENT (SORT_BY_NAME (.bsp_nvram*)))
375                bsp_section_nvram_end = .;
376        } > REGION_NVRAM AT > REGION_NVRAM
377        bsp_section_nvram_size = bsp_section_nvram_end - bsp_section_nvram_begin;
378
379        /* FIXME */
380        RamBase = ORIGIN (REGION_WORK);
381        RamSize = LENGTH (REGION_WORK);
382        WorkAreaBase = bsp_section_work_begin;
383        HeapSize = 0;
384
385        /* Stabs debugging sections.  */
386        .stab          0 : { *(.stab) }
387        .stabstr       0 : { *(.stabstr) }
388        .stab.excl     0 : { *(.stab.excl) }
389        .stab.exclstr  0 : { *(.stab.exclstr) }
390        .stab.index    0 : { *(.stab.index) }
391        .stab.indexstr 0 : { *(.stab.indexstr) }
392        .comment       0 : { *(.comment) }
393        /* DWARF debug sections.
394           Symbols in the DWARF debugging sections are relative to the beginning
395           of the section so we begin them at 0.  */
396        /* DWARF 1 */
397        .debug          0 : { *(.debug) }
398        .line           0 : { *(.line) }
399        /* GNU DWARF 1 extensions */
400        .debug_srcinfo  0 : { *(.debug_srcinfo) }
401        .debug_sfnames  0 : { *(.debug_sfnames) }
402        /* DWARF 1.1 and DWARF 2 */
403        .debug_aranges  0 : { *(.debug_aranges) }
404        .debug_pubnames 0 : { *(.debug_pubnames) }
405        /* DWARF 2 */
406        .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
407        .debug_abbrev   0 : { *(.debug_abbrev) }
408        .debug_line     0 : { *(.debug_line .debug_line.* .debug_line_end ) }
409        .debug_frame    0 : { *(.debug_frame) }
410        .debug_str      0 : { *(.debug_str) }
411        .debug_loc      0 : { *(.debug_loc) }
412        .debug_macinfo  0 : { *(.debug_macinfo) }
413        /* SGI/MIPS DWARF 2 extensions */
414        .debug_weaknames 0 : { *(.debug_weaknames) }
415        .debug_funcnames 0 : { *(.debug_funcnames) }
416        .debug_typenames 0 : { *(.debug_typenames) }
417        .debug_varnames  0 : { *(.debug_varnames) }
418        /* DWARF 3 */
419        .debug_pubtypes 0 : { *(.debug_pubtypes) }
420        .debug_ranges   0 : { *(.debug_ranges) }
421        /* DWARF Extension.  */
422        .debug_macro    0 : { *(.debug_macro) }
423        .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
424        .PPC.EMB.apuinfo 0 : { *(.PPC.EMB.apuinfo) }
425        /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
426
427        /*
428         * This is a RTEMS specific section to catch all unexpected input
429         * sections.  In case you get an error like
430         *   "section `.unexpected_sections' will not fit in region
431         *   `UNEXPECTED_SECTIONS'"
432         * you have to figure out the offending input section and add it to the
433         * appropriate output section definition above.
434         */
435        .unexpected_sections : { *(*) } > UNEXPECTED_SECTIONS
436}
Note: See TracBrowser for help on using the repository browser.