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

4.115
Last change on this file since cab410f was cab410f, checked in by Sebastian Huber <sebastian.huber@…>, on 05/21/13 at 12:19:24

bsps: Update due to linker changes

In case the VMA and LMA regions differ, the LMA start address is now no
longer aligned with the alignment of the input sections:

http://sourceware.org/bugzilla/show_bug.cgi?id=15222

  • Property mode set to 100644
File size: 12.0 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 : {
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 : {
51                . = ALIGN (bsp_section_xbarrier_align);
52        } > REGION_TEXT
53
54        .text : ALIGN(32) {
55                bsp_section_text_begin = .;
56
57                *(SORT(.bsp_text*))
58
59                /* .text */
60                *(.text.unlikely .text.*_unlikely)
61                *(.text .stub .text.* .gnu.linkonce.t.*)
62                *(.gnu.warning)
63                *(.glink)
64
65                /* .init */
66                KEEP (*(.init))
67
68                /* .fini */
69                PROVIDE (_fini = .);
70                KEEP (*(.fini))
71
72                bsp_section_text_end = .;
73        } > REGION_TEXT AT > REGION_TEXT_LOAD
74        bsp_section_text_size = bsp_section_text_end - bsp_section_text_begin;
75        bsp_section_text_load_begin = LOADADDR (.text);
76        bsp_section_text_load_end = bsp_section_text_load_begin + bsp_section_text_size;
77
78        .fast_text : ALIGN(32) {
79                bsp_section_fast_text_begin = .;
80                *(.bsp_fast_text)
81                bsp_section_fast_text_end = .;
82        } > REGION_FAST_TEXT AT > REGION_FAST_TEXT_LOAD
83        bsp_section_fast_text_size = bsp_section_fast_text_end - bsp_section_fast_text_begin;
84        bsp_section_fast_text_load_begin = LOADADDR (.fast_text);
85        bsp_section_fast_text_load_end = bsp_section_fast_text_load_begin + bsp_section_fast_text_size;
86
87        .robarrier : {
88                . = ALIGN (bsp_section_robarrier_align);
89        } > REGION_RODATA
90
91        .rodata : ALIGN(32) {
92                bsp_section_rodata_begin = .;
93
94                *(SORT(.bsp_rodata*))
95
96                /* .rodata */
97                *(.rodata .rodata.* .gnu.linkonce.r.*)
98
99                /* .rodata1 */
100                *(.rodata1)
101
102                /* .eh_frame_hdr */
103                *(.eh_frame_hdr)
104
105                /* .eh_frame */
106                KEEP (*(.eh_frame))
107
108                /* .gcc_except_table */
109                *(.gcc_except_table .gcc_except_table.*)
110
111                /* .tdata */
112                *(.tdata .tdata.* .gnu.linkonce.td.*)
113
114                /* .tbss */
115                *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
116
117                /* .preinit_array */
118                PROVIDE_HIDDEN (__preinit_array_start = .);
119                KEEP (*(.preinit_array))
120                PROVIDE_HIDDEN (__preinit_array_end = .);
121
122                /* .init_array */
123                PROVIDE_HIDDEN (__init_array_start = .);
124                KEEP (*(SORT(.init_array.*)))
125                KEEP (*(.init_array))
126                PROVIDE_HIDDEN (__init_array_end = .);
127
128                /* .fini_array */
129                PROVIDE_HIDDEN (__fini_array_start = .);
130                KEEP (*(SORT(.fini_array.*)))
131                KEEP (*(.fini_array))
132                PROVIDE_HIDDEN (__fini_array_end = .);
133
134                /* .ctors */
135                KEEP (*crtbegin.o(.ctors))
136                KEEP (*crtbegin?.o(.ctors))
137                KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
138                KEEP (*(SORT(.ctors.*)))
139                KEEP (*(.ctors))
140
141                /* .dtors */
142                KEEP (*crtbegin.o(.dtors))
143                KEEP (*crtbegin?.o(.dtors))
144                KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
145                KEEP (*(SORT(.dtors.*)))
146                KEEP (*(.dtors))
147
148                /* .jcr */
149                KEEP (*(.jcr))
150
151                /* .data.rel.ro */
152                *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*)
153
154                /* .fixpup */
155                *(.fixup)
156
157                /* .dynamic */
158                *(.dynamic)
159
160                /* .got1 */
161                *(.got1)
162
163                /* .got2 */
164                *(.got2)
165
166                /* .got */
167                *(.got)
168
169                /* .plt */
170                *(.plt)
171
172                /* .iptl */
173                *(.iplt)
174
175                /* .interp */
176                *(.interp)
177
178                /* .note.gnu.build-id */
179                *(.note.gnu.build-id)
180
181                /* .hash */
182                *(.hash)
183
184                /* .gnu.hash */
185                *(.gnu.hash)
186
187                /* .dynsym */
188                *(.dynsym)
189
190                /* .dynstr */
191                *(.dynstr)
192
193                /* .gnu.version */
194                *(.gnu.version)
195
196                /* .gnu.version_d */
197                *(.gnu.version_d)
198
199                /* .gnu.version_r */
200                *(.gnu.version_r)
201
202                /* .rela.dyn */
203                *(.rela.init)
204                *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
205                *(.rela.fini)
206                *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
207                *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
208                *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
209                *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
210                *(.rela.ctors)
211                *(.rela.dtors)
212                *(.rela.got)
213                *(.rela.got1)
214                *(.rela.got2)
215                *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
216                *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
217                *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
218                *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
219                *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
220                PROVIDE_HIDDEN (__rel_iplt_start = .);
221                PROVIDE_HIDDEN (__rel_iplt_end = .);
222                PROVIDE_HIDDEN (__rela_iplt_start = .);
223                *(.rela.iplt)
224                PROVIDE_HIDDEN (__rela_iplt_end = .);
225
226                /* .rela.plt */
227                *(.rela.plt)
228
229                /* Special FreeBSD linker set sections */
230                __start_set_sysctl_set = .;
231                *(set_sysctl_*);
232                __stop_set_sysctl_set = .;
233                *(set_domain_*);
234                *(set_pseudo_*);
235                _bsd__start_set_modmetadata_set = .;
236                *(_bsd_set_modmetadata_set);
237                _bsd__stop_set_modmetadata_set = .;
238                _bsd__start_set_sysctl_set = .;
239                *(_bsd_set_sysctl_set);
240                _bsd__stop_set_sysctl_set = .;
241
242                bsp_section_rodata_end = .;
243        } > REGION_RODATA AT > REGION_RODATA_LOAD
244        bsp_section_rodata_size = bsp_section_rodata_end - bsp_section_rodata_begin;
245        bsp_section_rodata_load_begin = LOADADDR (.rodata);
246        bsp_section_rodata_load_end = bsp_section_rodata_load_begin + bsp_section_rodata_size;
247
248        .sdata2 : ALIGN(32) {
249                bsp_section_sdata2_begin = .;
250
251                /* .sdata2 */
252                PROVIDE (_SDA2_BASE_ = 32768);
253                *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
254
255                /* .sbss2 */
256                *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
257
258                bsp_section_sdata2_end = .;
259        } > REGION_RODATA AT > REGION_RODATA_LOAD
260        bsp_section_sdata2_size = bsp_section_sdata2_end - bsp_section_sdata2_begin;
261        bsp_section_sdata2_load_begin = LOADADDR (.sdata2);
262        bsp_section_sdata2_load_end = bsp_section_sdata2_load_begin + bsp_section_sdata2_size;
263
264        .rwbarrier : {
265                . = ALIGN (bsp_section_rwbarrier_align);
266        } > REGION_DATA
267
268        .fast_data : ALIGN(32) {
269                bsp_section_fast_data_begin = .;
270                *(SORT(.bsp_fast_data*))
271                bsp_section_fast_data_end = .;
272        } > REGION_FAST_DATA AT > REGION_FAST_DATA_LOAD
273        bsp_section_fast_data_size = bsp_section_fast_data_end - bsp_section_fast_data_begin;
274        bsp_section_fast_data_load_begin = LOADADDR (.fast_data);
275        bsp_section_fast_data_load_end = bsp_section_fast_data_load_begin + bsp_section_fast_data_size;
276
277        .data : ALIGN(32) {
278                bsp_section_data_begin = .;
279
280                *(SORT(.bsp_data*))
281
282                /* .data */
283                *(.data .data.* .gnu.linkonce.d.*)
284                SORT(CONSTRUCTORS)
285
286                /* .data1 */
287                *(.data1)
288
289                /* Special FreeBSD linker set sections */
290                _bsd__start_set_sysinit_set = .;
291                *(_bsd_set_sysinit_set);
292                _bsd__stop_set_sysinit_set = .;
293
294                bsp_section_data_end = .;
295        } > REGION_DATA AT > REGION_DATA_LOAD
296        bsp_section_data_size = bsp_section_data_end - bsp_section_data_begin;
297        bsp_section_data_load_begin = LOADADDR (.data);
298        bsp_section_data_load_end = bsp_section_data_load_begin + bsp_section_data_size;
299
300        .sdata : ALIGN(32) {
301                bsp_section_sdata_begin = .;
302
303                /* .sdata */
304                PROVIDE (_SDA_BASE_ = 32768);
305                *(.sdata .sdata.* .gnu.linkonce.s.*)
306
307                bsp_section_sdata_end = .;
308        } > REGION_DATA AT > REGION_DATA_LOAD
309        bsp_section_sdata_size = bsp_section_sdata_end - bsp_section_sdata_begin;
310        bsp_section_sdata_load_begin = LOADADDR (.sdata);
311        bsp_section_sdata_load_end = bsp_section_sdata_load_begin + bsp_section_sdata_size;
312
313        .sbss : {
314                bsp_section_sbss_begin = .;
315                *(.dynsbss)
316                *(.sbss .sbss.* .gnu.linkonce.sb.*)
317                *(.scommon)
318                bsp_section_sbss_end = .;
319        } > REGION_DATA AT > REGION_DATA
320        bsp_section_sbss_size = bsp_section_sbss_end - bsp_section_sbss_begin;
321
322        .bss : {
323                bsp_section_bss_begin = .;
324                *(.dynbss)
325                *(.bss .bss.* .gnu.linkonce.b.*)
326                *(COMMON)
327                bsp_section_bss_end = .;
328        } > REGION_BSS AT > REGION_BSS
329        bsp_section_bss_size = bsp_section_bss_end - bsp_section_bss_begin;
330
331        .rwextra : {
332                bsp_section_rwextra_begin = .;
333                *(.bsp_rwextra)
334                bsp_section_rwextra_end = .;
335        } > REGION_RWEXTRA AT > REGION_RWEXTRA
336        bsp_section_rwextra_size = bsp_section_rwextra_end - bsp_section_rwextra_begin;
337
338        .work : {
339                /*
340                 * The work section will occupy the remaining REGION_WORK region and
341                 * contains the RTEMS work space and heap.
342                 */
343                bsp_section_work_begin = .;
344                . += ORIGIN (REGION_WORK) + LENGTH (REGION_WORK) - ABSOLUTE (.);
345                bsp_section_work_end = .;
346        } > REGION_WORK AT > REGION_WORK
347        bsp_section_work_size = bsp_section_work_end - bsp_section_work_begin;
348
349        .stack : {
350                /*
351                 * The stack section will occupy the remaining REGION_STACK region and may
352                 * contain the task stacks.  Depending on the region distribution this
353                 * section may be of zero size.
354                 */
355                bsp_section_stack_begin = .;
356                . += ORIGIN (REGION_STACK) + LENGTH (REGION_STACK) - ABSOLUTE (.);
357                bsp_section_stack_end = .;
358        } > REGION_STACK AT > REGION_STACK
359        bsp_section_stack_size = bsp_section_stack_end - bsp_section_stack_begin;
360
361        .nocache : {
362                bsp_section_nocache_begin = .;
363                *(SORT(.bsp_nocache*))
364                bsp_section_nocache_end = .;
365        } > REGION_NOCACHE AT > REGION_NOCACHE_LOAD
366        bsp_section_nocache_size = bsp_section_nocache_end - bsp_section_nocache_begin;
367        bsp_section_nocache_load_begin = LOADADDR (.nocache);
368        bsp_section_nocache_load_end = bsp_section_nocache_load_begin + bsp_section_nocache_size;
369
370        .nvram (NOLOAD) : {
371                bsp_section_nvram_begin = .;
372                *(SORT(.bsp_nvram*))
373                bsp_section_nvram_end = .;
374        } > 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 .zdebug_srcinfo) }
399        .debug_sfnames  0 : { *(.debug_sfnames .zdebug_sfnames) }
400        /* DWARF 1.1 and DWARF 2 */
401        .debug_aranges  0 : { *(.debug_aranges .zdebug_aranges) }
402        .debug_pubnames 0 : { *(.debug_pubnames .zdebug_pubnames) }
403        /* DWARF 2 */
404        .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.* .zdebug_info) }
405        .debug_abbrev   0 : { *(.debug_abbrev .zdebug_abbrev) }
406        .debug_line     0 : { *(.debug_line .zdebug_line) }
407        .debug_frame    0 : { *(.debug_frame .zdebug_frame) }
408        .debug_str      0 : { *(.debug_str .zdebug_str) }
409        .debug_loc      0 : { *(.debug_loc .zdebug_loc) }
410        .debug_macinfo  0 : { *(.debug_macinfo .zdebug_macinfo) }
411        /* SGI/MIPS DWARF 2 extensions */
412        .debug_weaknames 0 : { *(.debug_weaknames .zdebug_weaknames) }
413        .debug_funcnames 0 : { *(.debug_funcnames .zdebug_funcnames) }
414        .debug_typenames 0 : { *(.debug_typenames .zdebug_typenames) }
415        .debug_varnames  0 : { *(.debug_varnames .zdebug_varnames) }
416        /* DWARF 3 */
417        .debug_pubtypes 0 : { *(.debug_pubtypes .zdebug_pubtypes) }
418        .debug_ranges   0 : { *(.debug_ranges .zdebug_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.