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

4.115
Last change on this file since 960fd85 was 960fd85, checked in by Sebastian Huber <sebastian.huber@…>, on 01/28/14 at 10:52:17

bsps: Thread-local storage (TLS) for linkcmds

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