source: rtems/bsps/epiphany/epiphany_sim/start/linkcmds @ 9964895

5
Last change on this file since 9964895 was 9964895, checked in by Sebastian Huber <sebastian.huber@…>, on 04/20/18 at 08:35:35

bsps: Move startup files to bsps

Adjust build support files to new directory layout.

This patch is a part of the BSP source reorganization.

Update #3285.

  • Property mode set to 100644
File size: 13.8 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup bsp_linker
5 *
6 * @brief Memory map
7 */
8
9/*
10 *
11 * Copyright (c) 2015 University of York.
12 * Hesham ALMatary <hmka501@york.ac.uk>
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
16 * are met:
17 * 1. Redistributions of source code must retain the above copyright
18 *    notice, this list of conditions and the following disclaimer.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 *    notice, this list of conditions and the following disclaimer in the
21 *    documentation and/or other materials provided with the distribution.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 */
35
36OUTPUT_FORMAT("elf32-epiphany", "elf32-epiphany", "elf32-epiphany")
37OUTPUT_ARCH (epiphany)
38
39ENTRY (_start)
40STARTUP (start.o)
41
42MEMORY
43{
44  VECTOR_RAM  (AIW) : ORIGIN = 0x00000000, LENGTH = 0xB0
45  LOCAL_MEM   (AIW) : ORIGIN = 0x000000B0, LENGTH = 0x00007FC0 /* 32KiB Local memory */
46  RAM               : ORIGIN = 0x8E000000, LENGTH = 0x01000000 /* 16MiB external RAM */
47}
48
49REGION_ALIAS ("REGION_START", LOCAL_MEM);
50REGION_ALIAS ("REGION_VECTOR", VECTOR_RAM);
51REGION_ALIAS ("REGION_TEXT", RAM);
52REGION_ALIAS ("REGION_TEXT_LOAD", RAM);
53REGION_ALIAS ("REGION_RODATA", RAM);
54REGION_ALIAS ("REGION_RODATA_LOAD", RAM);
55REGION_ALIAS ("REGION_DATA", RAM);
56REGION_ALIAS ("REGION_DATA_LOAD", RAM);
57REGION_ALIAS ("REGION_FAST_DATA", RAM);
58REGION_ALIAS ("REGION_FAST_DATA_LOAD", RAM);
59REGION_ALIAS ("REGION_BSS", RAM);
60REGION_ALIAS ("REGION_WORK", RAM);
61REGION_ALIAS ("REGION_STACK", RAM);
62
63/* The following address is used for text output */
64bsp_section_outbut_buffer = 0x8F800000;
65bsp_section_vector_begin  = 0x00000000;
66
67/*
68 * Global symbols that may be defined externally
69 */
70bsp_vector_table_size = DEFINED (bsp_vector_table_size) ? bsp_vector_table_size : 64;
71
72bsp_section_xbarrier_align  = DEFINED (bsp_section_xbarrier_align) ? bsp_section_xbarrier_align : 1;
73bsp_section_robarrier_align = DEFINED (bsp_section_robarrier_align) ? bsp_section_robarrier_align : 1;
74bsp_section_rwbarrier_align = DEFINED (bsp_section_rwbarrier_align) ? bsp_section_rwbarrier_align : 1;
75
76bsp_stack_align = DEFINED (bsp_stack_align) ? bsp_stack_align : 8;
77
78bsp_stack_main_size = DEFINED (bsp_stack_main_size) ? bsp_stack_main_size : 1024;
79bsp_stack_main_size = ALIGN (bsp_stack_main_size, bsp_stack_align);
80
81_bsp_processor_count = DEFINED (_bsp_processor_count) ? _bsp_processor_count : 1;
82
83SECTIONS {
84
85  .vector :
86  {
87    *(.vector)
88    . = ALIGN(bsp_vector_table_size);
89    bsp_section_vector_end = .;
90  } > REGION_VECTOR AT > REGION_VECTOR
91  bsp_section_vector_size = bsp_section_vector_end - bsp_section_vector_begin;
92  bsp_vector_table_begin = bsp_section_vector_begin;
93  bsp_vector_table_end = bsp_vector_table_begin + bsp_vector_table_size;
94
95  .start :
96  {
97    . = ALIGN(8);
98    bsp_section_start_begin = .;
99    KEEP (*(.bsp_start_text))
100    KEEP (*(.bsp_start_data))
101    bsp_section_start_end = .;
102  } > REGION_START AT > REGION_START
103  bsp_section_start_size = bsp_section_start_end - bsp_section_start_begin;
104
105.xbarrier :   {
106    . = ALIGN (bsp_section_xbarrier_align);
107  } > REGION_VECTOR AT > REGION_VECTOR
108
109.text :   {
110    . = ALIGN(8);
111    bsp_section_text_begin = .;
112    *(.text.unlikely .text.*_unlikely)
113    *(.text .stub .text.* .gnu.linkonce.t.*)
114    /* .gnu.warning sections are handled specially by elf32.em.  */
115    *(.gnu.warning)
116    *(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx)
117  } > REGION_TEXT AT > REGION_TEXT_LOAD
118  .init :   {
119    KEEP (*(.init))
120  } > REGION_TEXT AT > REGION_TEXT_LOAD
121  .fini :   {
122    KEEP (*(.fini))
123    . = ALIGN(8);
124    bsp_section_text_end = .;
125  } > REGION_TEXT AT > REGION_TEXT_LOAD
126  bsp_section_text_size = bsp_section_text_end - bsp_section_text_begin;
127  bsp_section_text_load_begin = LOADADDR (.text);
128  bsp_section_text_load_end = bsp_section_text_load_begin + bsp_section_text_size;
129
130.robarrier :   {
131    . = ALIGN (bsp_section_robarrier_align);
132  } > REGION_RODATA AT > REGION_RODATA
133
134.rodata :   {
135    . = ALIGN(8);
136    bsp_section_rodata_begin = .;
137    *(.rodata .rodata.* .gnu.linkonce.r.*)
138  } > REGION_RODATA AT > REGION_RODATA_LOAD
139.eh_frame :   {
140               KEEP (*(.eh_frame))
141       } > REGION_RODATA AT > REGION_RODATA_LOAD
142       .gcc_except_table :   {
143               *(.gcc_except_table .gcc_except_table.*)
144       } > REGION_RODATA AT > REGION_RODATA_LOAD
145       .tdata :   {
146               _TLS_Data_begin = .;
147               *(.tdata .tdata.* .gnu.linkonce.td.*)
148               _TLS_Data_end = .;
149       } > REGION_RODATA AT > REGION_RODATA_LOAD
150       .tbss :   {
151               _TLS_BSS_begin = .;
152               *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
153               _TLS_BSS_end = .;
154       } > REGION_RODATA AT > REGION_RODATA_LOAD
155       _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
156       _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
157       _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
158       _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
159       _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
160       _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
161       .preinit_array :   {
162               PROVIDE_HIDDEN (__preinit_array_start = .);
163               KEEP (*(.preinit_array))
164               PROVIDE_HIDDEN (__preinit_array_end = .);
165       } > REGION_RODATA AT > REGION_RODATA_LOAD
166       .init_array :   {
167               PROVIDE_HIDDEN (__init_array_start = .);
168               KEEP (*(SORT(.init_array.*)))
169               KEEP (*(.init_array))
170               PROVIDE_HIDDEN (__init_array_end = .);
171       } > REGION_RODATA AT > REGION_RODATA_LOAD
172       .fini_array :   {
173               PROVIDE_HIDDEN (__fini_array_start = .);
174               KEEP (*(.fini_array))
175               KEEP (*(SORT(.fini_array.*)))
176               PROVIDE_HIDDEN (__fini_array_end = .);
177       } > REGION_RODATA AT > REGION_RODATA_LOAD
178       .ctors :   {
179               /* gcc uses crtbegin.o to find the start of
180                  the constructors, so we make sure it is
181                  first.  Because this is a wildcard, it
182                  doesn't matter if the user does not
183                  actually link against crtbegin.o; the
184                  linker won't look for a file to match a
185                  wildcard.  The wildcard also means that it
186                  doesn't matter which directory crtbegin.o
187                  is in.  */
188               KEEP (*crtbegin.o(.ctors))
189               KEEP (*crtbegin?.o(.ctors))
190               /* We don't want to include the .ctor section from
191                  the crtend.o file until after the sorted ctors.
192                  The .ctor section from the crtend file contains the
193                  end of ctors marker and it must be last */
194               KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
195               KEEP (*(SORT(.ctors.*)))
196               KEEP (*(.ctors))
197       } > REGION_RODATA AT > REGION_RODATA_LOAD
198       .dtors :   {
199               KEEP (*crtbegin.o(.dtors))
200               KEEP (*crtbegin?.o(.dtors))
201               KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
202               KEEP (*(SORT(.dtors.*)))
203               KEEP (*(.dtors))
204       } > REGION_RODATA AT > REGION_RODATA_LOAD
205       .data.rel.ro :   {
206               *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*)
207               *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*)
208       } > REGION_RODATA AT > REGION_RODATA_LOAD
209       .jcr :   {
210               KEEP (*(.jcr))
211       } > REGION_RODATA AT > REGION_RODATA_LOAD
212       .interp :   {
213               *(.interp)
214       } > REGION_RODATA AT > REGION_RODATA_LOAD
215       .note.gnu.build-id :   {
216               *(.note.gnu.build-id)
217       } > REGION_RODATA AT > REGION_RODATA_LOAD
218       .hash :   {
219               *(.hash)
220       } > REGION_RODATA AT > REGION_RODATA_LOAD
221       .gnu.hash :   {
222               *(.gnu.hash)
223       } > REGION_RODATA AT > REGION_RODATA_LOAD
224       .dynsym :   {
225               *(.dynsym)
226       } > REGION_RODATA AT > REGION_RODATA_LOAD
227       .dynstr :   {
228               *(.dynstr)
229       } > REGION_RODATA AT > REGION_RODATA_LOAD
230       .gnu.version :   {
231               *(.gnu.version)
232       } > REGION_RODATA AT > REGION_RODATA_LOAD
233       .gnu.version_d :   {
234               *(.gnu.version_d)
235       } > REGION_RODATA AT > REGION_RODATA_LOAD
236       .gnu.version_r :   {
237               *(.gnu.version_r)
238       } > REGION_RODATA AT > REGION_RODATA_LOAD
239       .rel.dyn :   {
240               *(.rel.init)
241               *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
242               *(.rel.fini)
243               *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
244               *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
245               *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
246               *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
247               *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
248               *(.rel.ctors)
249               *(.rel.dtors)
250               *(.rel.got)
251               *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
252               PROVIDE_HIDDEN (__rel_iplt_start = .);
253               *(.rel.iplt)
254               PROVIDE_HIDDEN (__rel_iplt_end = .);
255               PROVIDE_HIDDEN (__rela_iplt_start = .);
256               PROVIDE_HIDDEN (__rela_iplt_end = .);
257       } > REGION_RODATA AT > REGION_RODATA_LOAD
258       .rela.dyn :   {
259               *(.rela.init)
260               *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
261               *(.rela.fini)
262               *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
263               *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
264               *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
265               *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
266               *(.rela.ctors)
267               *(.rela.dtors)
268               *(.rela.got)
269               *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
270               PROVIDE_HIDDEN (__rel_iplt_start = .);
271               PROVIDE_HIDDEN (__rel_iplt_end = .);
272               PROVIDE_HIDDEN (__rela_iplt_start = .);
273               *(.rela.iplt)
274               PROVIDE_HIDDEN (__rela_iplt_end = .);
275       } > REGION_RODATA AT > REGION_RODATA_LOAD
276       .rel.plt :   {
277               *(.rel.plt)
278       } > REGION_RODATA AT > REGION_RODATA_LOAD
279       .rela.plt :   {
280               *(.rela.plt)
281       } > REGION_RODATA AT > REGION_RODATA_LOAD
282       .plt :   {
283               *(.plt)
284       } > REGION_RODATA AT > REGION_RODATA_LOAD
285       .iplt :   {
286               *(.iplt)
287       } > REGION_RODATA AT > REGION_RODATA_LOAD
288       .dynamic :   {
289               *(.dynamic)
290       } > REGION_RODATA AT > REGION_RODATA_LOAD
291       .got :   {
292               *(.got.plt) *(.igot.plt) *(.got) *(.igot)
293       } > REGION_RODATA AT > REGION_RODATA_LOAD
294       .rtemsroset :   {
295               /* Special FreeBSD linker set sections */
296               __start_set_sysctl_set = .;
297               *(set_sysctl_*);
298               __stop_set_sysctl_set = .;
299               *(set_domain_*);
300               *(set_pseudo_*);
301
302               KEEP (*(SORT(.rtemsroset.*)))
303               . = ALIGN(8);
304               bsp_section_rodata_end = .;
305       } > REGION_RODATA AT > REGION_RODATA_LOAD
306  bsp_section_rodata_size = bsp_section_rodata_end - bsp_section_rodata_begin;
307  bsp_section_rodata_load_begin = LOADADDR (.rodata);
308  bsp_section_rodata_load_end = bsp_section_rodata_load_begin + bsp_section_rodata_size;
309
310.rwbarrier :   {
311    . = ALIGN(8);
312    . = ALIGN (bsp_section_rwbarrier_align);
313  } > REGION_DATA AT > REGION_DATA
314
315.data :   {
316    . = ALIGN(8);
317    bsp_section_data_begin = .;
318    *(.data .data.* .gnu.linkonce.d.*)
319    SORT(CONSTRUCTORS)
320  } > REGION_DATA AT > REGION_DATA_LOAD
321  .data1 :   {
322    *(.data1)
323  } > REGION_DATA AT > REGION_DATA_LOAD
324  .rtemsrwset :   {
325    KEEP (*(SORT(.rtemsrwset.*)))
326    . = ALIGN(8);
327    bsp_section_data_end = .;
328  } > REGION_DATA AT > REGION_DATA_LOAD
329  bsp_section_data_size = bsp_section_data_end - bsp_section_data_begin;
330  bsp_section_data_load_begin = LOADADDR (.data);
331  bsp_section_data_load_end = bsp_section_data_load_begin + bsp_section_data_size;
332
333  .bss :   {
334    . = ALIGN(8);
335    bsp_section_bss_begin = .;
336    *(.dynbss)
337    *(.bss .bss.* .gnu.linkonce.b.*)
338    *(COMMON)
339    . = ALIGN(8);
340    bsp_section_bss_end = .;
341  } > REGION_BSS AT > REGION_BSS
342  bsp_section_bss_size = bsp_section_bss_end - bsp_section_bss_begin;
343
344.work :   {
345    /*
346     * The work section will occupy the remaining REGION_WORK region and
347     * contains the RTEMS work space and heap.
348     */
349    . = ALIGN(8);
350    bsp_section_work_begin = .;
351    . += ORIGIN (REGION_WORK) + LENGTH (REGION_WORK) - ABSOLUTE (.);
352    . = ALIGN(8);
353    bsp_section_work_end = .;
354  } > REGION_WORK AT > REGION_WORK
355  bsp_section_work_size = bsp_section_work_end - bsp_section_work_begin;
356
357  .stack :   {
358    . = ALIGN(8);
359    bsp_section_stack_begin = .;
360    . += ORIGIN (REGION_STACK) + LENGTH (REGION_STACK) - ABSOLUTE (.);
361    . = ALIGN(8);
362    bsp_section_stack_end = .;
363  } > REGION_STACK AT > REGION_STACK
364  bsp_section_stack_size = bsp_section_stack_begin - bsp_section_stack_end;
365
366  RamBase = ORIGIN (REGION_WORK);
367  RamSize = LENGTH (REGION_WORK);
368  WorkAreaBase = bsp_section_work_begin;
369  HeapSize = 0;
370}
Note: See TracBrowser for help on using the repository browser.