source: rtems/bsps/arm/shared/start/linkcmds.base @ 186a0b1

5
Last change on this file since 186a0b1 was 186a0b1, checked in by Sebastian Huber <sebastian.huber@…>, on 10/15/18 at 08:38:49

bsps/arm: Recognize .tm_clone_table input section

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