source: rtems/c/src/lib/libbsp/m68k/shared/startup/linkcmds.base @ d440a9e

5
Last change on this file since d440a9e was d440a9e, checked in by Sebastian Huber <sebastian.huber@…>, on 03/07/18 at 09:32:09

bsps/m68k: Fix entry point in linkcmds.base

Updates #3520.

  • Property mode set to 100644
File size: 10.6 KB
Line 
1/*
2 * Copyright (c) 2008-2013 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Dornierstr. 4
6 *  82178 Puchheim
7 *  Germany
8 *  <rtems@embedded-brains.de>
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.org/license/LICENSE.
13 */
14
15OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k")
16
17OUTPUT_ARCH(m68k)
18
19ENTRY(start)
20STARTUP(start.o)
21
22bsp_initstack_size = DEFINED (bsp_initstack_size) ? bsp_initstack_size : 2048;
23
24MEMORY {
25        UNEXPECTED_SECTIONS : ORIGIN = 0xffffffff, LENGTH = 0
26}
27
28SECTIONS {
29        .vector0 : ALIGN_WITH_INPUT {
30                bsp_vector0_begin = .;
31                KEEP (*(.vectors*))
32                bsp_vector0_end = .;
33        } > REGION_TEXT AT > REGION_TEXT
34        bsp_vector0_size = bsp_vector0_end - bsp_vector0_begin;
35
36        .text : ALIGN_WITH_INPUT {
37                *(.text.unlikely .text.*_unlikely)
38                *(.text .stub .text.* .gnu.linkonce.t.*)
39                /* .gnu.warning sections are handled specially by elf32.em.  */
40                *(.gnu.warning)
41        } > REGION_TEXT AT > REGION_TEXT_LOAD
42        .init : ALIGN_WITH_INPUT {
43                KEEP (*(.init))
44        } > REGION_TEXT AT > REGION_TEXT_LOAD
45        .fini : ALIGN_WITH_INPUT {
46                KEEP (*(.fini))
47        } > REGION_TEXT AT > REGION_TEXT_LOAD
48        .rodata : ALIGN_WITH_INPUT {
49                *(.rodata .rodata.* .gnu.linkonce.r.*)
50        } > REGION_TEXT AT > REGION_TEXT_LOAD
51        .rodata1 : ALIGN_WITH_INPUT {
52                *(.rodata1)
53        } > REGION_TEXT AT > REGION_TEXT_LOAD
54        .eh_frame : ALIGN_WITH_INPUT {
55                KEEP (*(.eh_frame))
56        } > REGION_TEXT AT > REGION_TEXT_LOAD
57        .gcc_except_table : ALIGN_WITH_INPUT {
58                *(.gcc_except_table .gcc_except_table.*)
59        } > REGION_TEXT AT > REGION_TEXT_LOAD
60        .tdata : ALIGN_WITH_INPUT {
61                _TLS_Data_begin = .;
62                *(.tdata .tdata.* .gnu.linkonce.td.*)
63                _TLS_Data_end = .;
64        } > REGION_TEXT AT > REGION_TEXT_LOAD
65        .tbss : ALIGN_WITH_INPUT {
66                _TLS_BSS_begin = .;
67                *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
68                _TLS_BSS_end = .;
69        } > REGION_TEXT AT > REGION_TEXT_LOAD
70        _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
71        _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
72        _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
73        _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
74        _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
75        _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
76        .preinit_array : ALIGN_WITH_INPUT {
77                PROVIDE_HIDDEN (__preinit_array_start = .);
78                KEEP (*(.preinit_array))
79                PROVIDE_HIDDEN (__preinit_array_end = .);
80        } > REGION_TEXT AT > REGION_TEXT_LOAD
81        .init_array : ALIGN_WITH_INPUT {
82                PROVIDE_HIDDEN (__init_array_start = .);
83                KEEP (*(SORT(.init_array.*)))
84                KEEP (*(.init_array))
85                PROVIDE_HIDDEN (__init_array_end = .);
86        } > REGION_TEXT AT > REGION_TEXT_LOAD
87        .fini_array : ALIGN_WITH_INPUT {
88                PROVIDE_HIDDEN (__fini_array_start = .);
89                KEEP (*(.fini_array))
90                KEEP (*(SORT(.fini_array.*)))
91                PROVIDE_HIDDEN (__fini_array_end = .);
92        } > REGION_TEXT AT > REGION_TEXT_LOAD
93        .ctors : ALIGN_WITH_INPUT {
94                /* gcc uses crtbegin.o to find the start of
95                   the constructors, so we make sure it is
96                   first.  Because this is a wildcard, it
97                   doesn't matter if the user does not
98                   actually link against crtbegin.o; the
99                   linker won't look for a file to match a
100                   wildcard.  The wildcard also means that it
101                   doesn't matter which directory crtbegin.o
102                   is in.  */
103                KEEP (*crtbegin.o(.ctors))
104                KEEP (*crtbegin?.o(.ctors))
105                /* We don't want to include the .ctor section from
106                   the crtend.o file until after the sorted ctors.
107                   The .ctor section from the crtend file contains the
108                   end of ctors marker and it must be last */
109                KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
110                KEEP (*(SORT(.ctors.*)))
111                KEEP (*(.ctors))
112        } > REGION_TEXT AT > REGION_TEXT_LOAD
113        .dtors : ALIGN_WITH_INPUT {
114                KEEP (*crtbegin.o(.dtors))
115                KEEP (*crtbegin?.o(.dtors))
116                KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
117                KEEP (*(SORT(.dtors.*)))
118                KEEP (*(.dtors))
119        } > REGION_TEXT AT > REGION_TEXT_LOAD
120        .data.rel.ro : ALIGN_WITH_INPUT {
121                *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*)
122                *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*)
123        } > REGION_TEXT AT > REGION_TEXT_LOAD
124        .jcr : ALIGN_WITH_INPUT {
125                KEEP (*(.jcr))
126        } > REGION_TEXT AT > REGION_TEXT_LOAD
127        .interp : ALIGN_WITH_INPUT {
128                *(.interp)
129        } > REGION_TEXT AT > REGION_TEXT_LOAD
130        .note.gnu.build-id : ALIGN_WITH_INPUT {
131                *(.note.gnu.build-id)
132        } > REGION_TEXT AT > REGION_TEXT_LOAD
133        .hash : ALIGN_WITH_INPUT {
134                *(.hash)
135        } > REGION_TEXT AT > REGION_TEXT_LOAD
136        .gnu.hash : ALIGN_WITH_INPUT {
137                *(.gnu.hash)
138        } > REGION_TEXT AT > REGION_TEXT_LOAD
139        .dynsym : ALIGN_WITH_INPUT {
140                *(.dynsym)
141        } > REGION_TEXT AT > REGION_TEXT_LOAD
142        .dynstr : ALIGN_WITH_INPUT {
143                *(.dynstr)
144        } > REGION_TEXT AT > REGION_TEXT_LOAD
145        .gnu.version : ALIGN_WITH_INPUT {
146                *(.gnu.version)
147        } > REGION_TEXT AT > REGION_TEXT_LOAD
148        .gnu.version_d : ALIGN_WITH_INPUT {
149                *(.gnu.version_d)
150        } > REGION_TEXT AT > REGION_TEXT_LOAD
151        .gnu.version_r : ALIGN_WITH_INPUT {
152                *(.gnu.version_r)
153        } > REGION_TEXT AT > REGION_TEXT_LOAD
154        .rel.dyn : ALIGN_WITH_INPUT {
155                *(.rel.init)
156                *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
157                *(.rel.fini)
158                *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
159                *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
160                *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
161                *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
162                *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
163                *(.rel.ctors)
164                *(.rel.dtors)
165                *(.rel.got)
166                *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
167                PROVIDE_HIDDEN (__rel_iplt_start = .);
168                *(.rel.iplt)
169                PROVIDE_HIDDEN (__rel_iplt_end = .);
170                PROVIDE_HIDDEN (__rela_iplt_start = .);
171                PROVIDE_HIDDEN (__rela_iplt_end = .);
172        } > REGION_TEXT AT > REGION_TEXT_LOAD
173        .rela.dyn : ALIGN_WITH_INPUT {
174                *(.rela.init)
175                *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
176                *(.rela.fini)
177                *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
178                *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
179                *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
180                *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
181                *(.rela.ctors)
182                *(.rela.dtors)
183                *(.rela.got)
184                *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
185                *(.rela.rtemsroset*)
186                *(.rela.rtemsrwset*)
187                PROVIDE_HIDDEN (__rel_iplt_start = .);
188                PROVIDE_HIDDEN (__rel_iplt_end = .);
189                PROVIDE_HIDDEN (__rela_iplt_start = .);
190                *(.rela.iplt)
191                PROVIDE_HIDDEN (__rela_iplt_end = .);
192        } > REGION_TEXT AT > REGION_TEXT_LOAD
193        .rel.plt : ALIGN_WITH_INPUT {
194                *(.rel.plt)
195        } > REGION_TEXT AT > REGION_TEXT_LOAD
196        .rela.plt : ALIGN_WITH_INPUT {
197                *(.rela.plt)
198        } > REGION_TEXT AT > REGION_TEXT_LOAD
199        .plt : ALIGN_WITH_INPUT {
200                *(.plt)
201        } > REGION_TEXT AT > REGION_TEXT_LOAD
202        .iplt : ALIGN_WITH_INPUT {
203                *(.iplt)
204        } > REGION_TEXT AT > REGION_TEXT_LOAD
205        .dynamic : ALIGN_WITH_INPUT {
206                *(.dynamic)
207        } > REGION_TEXT AT > REGION_TEXT_LOAD
208        .got : ALIGN_WITH_INPUT {
209                *(.got.plt) *(.igot.plt) *(.got) *(.igot)
210        } > REGION_TEXT AT > REGION_TEXT_LOAD
211        .rtemsroset : ALIGN_WITH_INPUT {
212                /* Special FreeBSD linker set sections */
213                __start_set_sysctl_set = .;
214                *(set_sysctl_*);
215                __stop_set_sysctl_set = .;
216                *(set_domain_*);
217                *(set_pseudo_*);
218
219                KEEP (*(SORT(.rtemsroset.*)))
220        } > REGION_TEXT AT > REGION_TEXT_LOAD
221
222        .vector1 : ALIGN_WITH_INPUT {
223                bsp_vector1_begin = .;
224                . = . + (ORIGIN (REGION_TEXT) == ORIGIN (REGION_DATA) ? 0 : bsp_vector0_size);
225                bsp_vector1_end = .;
226        } > REGION_DATA AT > REGION_DATA
227        bsp_vector1_size = bsp_vector1_end - bsp_vector1_begin;
228
229        .initstack : ALIGN_WITH_INPUT {
230                bsp_initstack_begin = .;
231                . = . + bsp_initstack_size;
232                bsp_initstack_end = .;
233        } > REGION_DATA AT > REGION_DATA
234
235        .data : ALIGN_WITH_INPUT {
236                bsp_section_data_begin = .;
237                *(.data .data.* .gnu.linkonce.d.*)
238                SORT(CONSTRUCTORS)
239        } > REGION_DATA AT > REGION_DATA_LOAD
240        .data1 : ALIGN_WITH_INPUT {
241                *(.data1)
242        } > REGION_DATA AT > REGION_DATA_LOAD
243        .rtemsrwset : ALIGN_WITH_INPUT {
244                KEEP (*(SORT(.rtemsrwset.*)))
245                bsp_section_data_end = .;
246        } > REGION_DATA AT > REGION_DATA_LOAD
247        bsp_section_data_size = bsp_section_data_end - bsp_section_data_begin;
248        bsp_section_data_load_begin = LOADADDR (.data);
249        bsp_section_data_load_end = bsp_section_data_load_begin + bsp_section_data_size;
250
251        .bss : ALIGN_WITH_INPUT {
252                bsp_section_bss_begin = .;
253                *(.dynbss)
254                *(.bss .bss.* .gnu.linkonce.b.*)
255                *(COMMON)
256                bsp_section_bss_end = .;
257        } > REGION_DATA AT > REGION_DATA
258        bsp_section_bss_size = bsp_section_bss_end - bsp_section_bss_begin;
259
260        .work : ALIGN_WITH_INPUT {
261                /*
262                 * The work section will occupy the remaining REGION_DATA region and
263                 * contains the RTEMS work space and heap.
264                 */
265                bsp_section_work_begin = .;
266                . += ORIGIN (REGION_DATA) + LENGTH (REGION_DATA) - ABSOLUTE (.);
267                bsp_section_work_end = .;
268        } > REGION_DATA AT > REGION_DATA
269        bsp_section_work_size = bsp_section_work_end - bsp_section_work_begin;
270
271        /* FIXME */
272        RamBase = ORIGIN (REGION_DATA);
273        RamSize = LENGTH (REGION_DATA);
274        WorkAreaBase = bsp_section_work_begin;
275        HeapSize = 0;
276
277        /* Stabs debugging sections.  */
278        .stab          0 : { *(.stab) }
279        .stabstr       0 : { *(.stabstr) }
280        .stab.excl     0 : { *(.stab.excl) }
281        .stab.exclstr  0 : { *(.stab.exclstr) }
282        .stab.index    0 : { *(.stab.index) }
283        .stab.indexstr 0 : { *(.stab.indexstr) }
284        .comment       0 : { *(.comment) }
285        /* DWARF debug sections.
286           Symbols in the DWARF debugging sections are relative to the beginning
287           of the section so we begin them at 0.  */
288        /* DWARF 1 */
289        .debug          0 : { *(.debug) }
290        .line           0 : { *(.line) }
291        /* GNU DWARF 1 extensions */
292        .debug_srcinfo  0 : { *(.debug_srcinfo) }
293        .debug_sfnames  0 : { *(.debug_sfnames) }
294        /* DWARF 1.1 and DWARF 2 */
295        .debug_aranges  0 : { *(.debug_aranges) }
296        .debug_pubnames 0 : { *(.debug_pubnames) }
297        /* DWARF 2 */
298        .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
299        .debug_abbrev   0 : { *(.debug_abbrev) }
300        .debug_line     0 : { *(.debug_line) }
301        .debug_frame    0 : { *(.debug_frame) }
302        .debug_str      0 : { *(.debug_str) }
303        .debug_loc      0 : { *(.debug_loc) }
304        .debug_macinfo  0 : { *(.debug_macinfo) }
305        /* SGI/MIPS DWARF 2 extensions */
306        .debug_weaknames 0 : { *(.debug_weaknames) }
307        .debug_funcnames 0 : { *(.debug_funcnames) }
308        .debug_typenames 0 : { *(.debug_typenames) }
309        .debug_varnames  0 : { *(.debug_varnames) }
310        /* DWARF 3 */
311        .debug_pubtypes 0 : { *(.debug_pubtypes) }
312        .debug_ranges   0 : { *(.debug_ranges) }
313        /* DWARF extension */
314        .debug_macro    0 : { *(.debug_macro) }
315        /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
316
317        /*
318         * This is a RTEMS specific section to catch all unexpected input
319         * sections.  In case you get an error like
320         *   "section `.unexpected_sections' will not fit in region
321         *   `UNEXPECTED_SECTIONS'"
322         * you have to figure out the offending input section and add it to the
323         * appropriate output section definition above.
324         */
325        .unexpected_sections : { *(*) } > UNEXPECTED_SECTIONS
326}
Note: See TracBrowser for help on using the repository browser.