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

5
Last change on this file since 1fcdd639 was 1fcdd639, checked in by Joel Sherrill <joel@…>, on 01/12/17 at 22:12:51

powerpc/shared/linkcmds.base: Add .rela.rtemsroset and .rela.rtemsrwset

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