source: rtems/bsps/sh/gensh4/start/linkcmds @ ffa1153

5
Last change on this file since ffa1153 was ffa1153, checked in by Sebastian Huber <sebastian.huber@…>, on 12/14/19 at 20:36:09

bsps: Add RamEnd? to linker command files

Update #3838.

  • Property mode set to 100644
File size: 5.6 KB
Line 
1/*
2 * This file contains GNU linker directives for an general SH4
3 * board.
4 *
5 * Variations in memory size and allocation can be made by
6 * overriding some values with linker command-line arguments.
7 *
8 * Copyright (C) 2000 OKTET Ltd., St.-Petersburg, Russia
9 * Author: Victor V. Vengerov <vvv@oktet.ru>
10 *
11 * The license and distribution terms for this file may be
12 * found in the file LICENSE in this distribution or at
13 *
14 * http://www.rtems.org/license/LICENSE.
15 */
16
17
18OUTPUT_ARCH(sh)
19ENTRY(_start)
20STARTUP(start.o)
21
22/* Do we need any of these for elf?
23   __DYNAMIC = 0;    */
24
25_RamBase = DEFINED(_RamBase) ? _RamBase : 0x80000000;
26_RamSize = DEFINED(_RamSize) ? _RamSize : 4M;
27_RamEnd = _RamBase + _RamSize;
28_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x0;
29
30/*
31 * Area assignments:
32 *     Area 0: Flash memory, SRAM interface
33 *     Area 1: GDC
34 *     Area 2: SDRAM
35 *     Area 3-6: unused
36 */
37MEMORY
38{
39  ram           : o = 0x88100000, l = 7M
40  rom           : o = 0x80000000, l = 4M
41}
42
43SECTIONS
44{
45  /* Read-only sections, merged into text segment: */
46  .text      :
47  {
48    _start = .;
49    *(.text*)
50
51    /*
52     * Special FreeBSD sysctl sections.
53     */
54    . = ALIGN (16);
55    ___start_set_sysctl_set = .;
56    *(set_sysc*);   /* set_sysctl_* but name is truncated by SH-coff */
57    ___stop_set_sysctl_set = ABSOLUTE(.);
58    *(set_doma*);   /* set_domain_* but name is truncated by SH-coff */
59    *(set_pseu*);   /* set_pseudo_* but name is truncated by SH-coff */
60
61    /* .gnu.warning sections are handled specially by elf32.em.  */
62    *(.gnu.warning)
63    *(.gnu.linkonce.t*)
64  } > ram
65  .rela.dyn       :
66    {
67      *(.rela.init)
68      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
69      *(.rela.fini)
70      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
71      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
72      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
73      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
74      *(.rela.ctors)
75      *(.rela.dtors)
76      *(.rela.got)
77      *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
78      *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
79      *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
80      *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
81      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
82    } >ram
83  _etext = .;
84  PROVIDE (etext = .);
85  .init    .  : { KEEP(*(.init))    } > ram =0
86  .fini    .  : { KEEP(*(.fini))    } > ram =0
87  .ctors   .  : { KEEP(*(.ctors))    } > ram =0
88  .dtors   .  : { KEEP(*(.dtors))    } > ram =0
89  .rodata   :
90  {
91    *(.rodata)
92    *(.rodata.*)
93    KEEP (*(SORT(.rtemsroset.*)))
94    *(.gnu.linkonce.r*)
95  } > ram
96  .tdata : {
97    __TLS_Data_begin = .;
98    *(.tdata .tdata.* .gnu.linkonce.td.*)
99    __TLS_Data_end = .;
100  } > ram
101  .tbss : {
102    __TLS_BSS_begin = .;
103    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
104    __TLS_BSS_end = .;
105  } > ram
106  __TLS_Data_size = __TLS_Data_end - __TLS_Data_begin;
107  __TLS_Data_begin = __TLS_Data_size != 0 ? __TLS_Data_begin : __TLS_BSS_begin;
108  __TLS_Data_end = __TLS_Data_size != 0 ? __TLS_Data_end : __TLS_BSS_begin;
109  __TLS_BSS_size = __TLS_BSS_end - __TLS_BSS_begin;
110  __TLS_Size = __TLS_BSS_end - __TLS_Data_begin;
111  __TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
112
113  /* Adjust the address for the data segment.  We want to adjust up to
114     the same address within the page on the next page up.  */
115  . = ALIGN(128) + (. & (128 - 1));
116  .data    :
117  {
118    copy_start = .;
119    *(.data*)
120    KEEP (*(SORT(.rtemsrwset.*)))
121    *(.gcc_exc*)
122    ___EH_FRAME_BEGIN__ = .;
123    *(.eh_fram*)
124    ___EH_FRAME_END__ = .;
125    LONG(0);
126    *(.gcc_except_table*)
127    *(.gnu.linkonce.d*)
128    SORT(CONSTRUCTORS)
129    copy_end = .;
130  } > ram
131  .eh_frame : { *(.eh_frame) } > ram
132  /* We want the small data sections together, so single-instruction offsets
133     can access them all, and initialized data all before uninitialized, so
134     we can shorten the on-disk segment size.  */
135  .bss       :
136  {
137   __bss_start = .;
138   *(.dynbss)
139   *(.bss .bss* .gnu.linkonce.b*)
140   *(COMMON)
141   /* Align here to ensure that the .bss section occupies space up to
142      _end.  Align after .bss to ensure correct alignment even if the
143      .bss section disappears because there are no input sections.  */
144   . = ALIGN(32 / 8);
145   __bss_end = .;
146  } > ram
147
148  .rtemsstack (NOLOAD) : {
149    *(SORT(.rtemsstack.*))
150  } > ram
151
152  _WorkAreaBase = . ;
153
154  /* Stabs debugging sections.  */
155  .stab 0 : { *(.stab) }
156  .stabstr 0 : { *(.stabstr) }
157  .stab.excl 0 : { *(.stab.excl) }
158  .stab.exclstr 0 : { *(.stab.exclstr) }
159  .stab.index 0 : { *(.stab.index) }
160  .stab.indexstr 0 : { *(.stab.indexstr) }
161  .comment 0 : { *(.comment) }
162  /* DWARF debug sections.
163     Symbols in the DWARF debugging sections are relative to the beginning
164     of the section so we begin them at 0.  */
165  /* DWARF 1 */
166  .debug          0 : { *(.debug) }
167  .line           0 : { *(.line) }
168  /* GNU DWARF 1 extensions */
169  .debug_srcinfo  0 : { *(.debug_srcinfo) }
170  .debug_sfnames  0 : { *(.debug_sfnames) }
171  /* DWARF 1.1 and DWARF 2 */
172  .debug_aranges  0 : { *(.debug_aranges) }
173  .debug_pubnames 0 : { *(.debug_pubnames) }
174  /* DWARF 2 */
175  .debug_info     0 : { *(.debug_info) }
176  .debug_abbrev   0 : { *(.debug_abbrev) }
177  .debug_line     0 : { *(.debug_line) }
178  .debug_frame    0 : { *(.debug_frame) }
179  .debug_str      0 : { *(.debug_str) }
180  .debug_loc      0 : { *(.debug_loc) }
181  .debug_macinfo  0 : { *(.debug_macinfo) }
182  /* SGI/MIPS DWARF 2 extensions */
183  .debug_weaknames 0 : { *(.debug_weaknames) }
184  .debug_funcnames 0 : { *(.debug_funcnames) }
185  .debug_typenames 0 : { *(.debug_typenames) }
186  .debug_varnames  0 : { *(.debug_varnames) }
187  /* These must appear regardless of  .  */
188}
Note: See TracBrowser for help on using the repository browser.