source: rtems/bsps/sh/gensh1/start/linkcmds @ 5ed00353

Last change on this file since 5ed00353 was 5ed00353, checked in by Sebastian Huber <sebastian.huber@…>, on 07/14/22 at 12:41:03

bsps: Sort .noinit* sections

Sort the .noinit* input sections by name first, then by alignment if two
sections have the same name. This allows the placement of begin/end symbols to
initialize some areas with a special value.

Update #4678.

  • Property mode set to 100644
File size: 7.2 KB
Line 
1/*
2 * This is an adapted linker script from egcs-1.0.1
3 *
4 * Memory layout for an SH 7032 with main memory in area 2
5 * This memory layout it very similar to that used for Hitachi's
6 * EVB with CMON in rom
7 *
8 * NOTE: The ram start address may vary, all other start addresses are fixed
9 *       Not suiteable for gdb's simulator
10 *
11 *  Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
12 *           Bernd Becker (becker@faw.uni-ulm.de)
13 *
14 *  COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
15 *
16 *  This program is distributed in the hope that it will be useful,
17 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
18 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 *
20 *
21 *  COPYRIGHT (c) 1998.
22 *  On-Line Applications Research Corporation (OAR).
23 *
24 *  The license and distribution terms for this file may be
25 *  found in the file LICENSE in this distribution or at
26 *  http://www.rtems.org/license/LICENSE.
27 */
28
29OUTPUT_ARCH(sh)
30ENTRY(_start)
31STARTUP(start.o)
32
33_RamBase = DEFINED(_RamBase) ? _RamBase : 0x0a040000;
34_RamSize = DEFINED(_RamSize) ? _RamSize : 512K;
35_RamEnd = _RamBase + _RamSize;
36_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x0;
37
38MEMORY
39{
40  rom           : o = 0x00000000, l = 128k
41  onchip_peri   : o = 0x05000000, l = 512
42  ram           : o = 0x0A040000, l = 512k  /* enough to link all tests */
43
44  onchip_ram    : o = 0x0f000000, l = 8k
45}
46
47SECTIONS
48{
49  /* boot vector table */
50  .monvects 0x00000000 (NOLOAD): {
51    _monvects = . ;
52  } > rom
53
54  /* monitor play area */
55  .monram 0x0A040000 (NOLOAD) :
56  {
57  _ramstart = .;
58  } > ram
59
60  /* monitor vector table */
61  .vects   0x0A042000 (NOLOAD) : {
62    _vectab = . ;
63    *(.vects);
64  }
65
66  /* Read-only sections, merged into text segment: */
67
68  . = 0x0a044000 ;
69  .interp        : { *(.interp)         }
70  .hash          : { *(.hash)           }
71  .dynsym        : { *(.dynsym)         }
72  .dynstr        : { *(.dynstr)         }
73  .gnu.version   : { *(.gnu.version)    }
74  .gnu.version_d : { *(.gnu.version_d)  }
75  .gnu.version_r : { *(.gnu.version_r)  }
76  .rela.dyn       :
77    {
78      *(.rela.init)
79      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
80      *(.rela.fini)
81      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
82      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
83      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
84      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
85      *(.rela.ctors)
86      *(.rela.dtors)
87      *(.rela.got)
88      *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
89      *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
90      *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
91      *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
92      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
93    } >ram
94  .rel.text      :
95    { *(.rel.text) *(.rel.gnu.linkonce.t*) }
96  .rel.data      :
97    { *(.rel.data) *(.rel.gnu.linkonce.d*) }
98  .rel.rodata    :
99    { *(.rel.rodata*) *(.rel.gnu.linkonce.r*) }
100  .rel.got       : { *(.rel.got)                }
101  .rel.ctors     : { *(.rel.ctors)      }
102  .rel.dtors     : { *(.rel.dtors)      }
103  .rel.init      : { *(.rel.init)       }
104  .rel.fini      : { *(.rel.fini)       }
105  .rel.bss       : { *(.rel.bss)                }
106  .rel.plt       : { *(.rel.plt)                }
107  .plt           : { *(.plt)    }
108  .text   .      :
109  {
110    _start = .;
111    *(.text*)
112    *(.stub)
113
114    /*
115     * Special FreeBSD sysctl sections.
116     */
117    . = ALIGN (16);
118    __start_set_sysctl_set = .;
119    ___start_set_sysctl_set = .;
120    *(set_sysc*);   /* set_sysctl_* but name is truncated by SH-coff */
121    __stop_set_sysctl_set = ABSOLUTE(.);
122    ___stop_set_sysctl_set = ABSOLUTE(.);
123    *(set_doma*);   /* set_domain_* but name is truncated by SH-coff */
124    *(set_pseu*);   /* set_pseudo_* but name is truncated by SH-coff */
125
126    /* .gnu.warning sections are handled specially by elf32.em.  */
127    *(.gnu.warning)
128    *(.gnu.linkonce.t*)
129  } > ram
130  _etext = .;
131  PROVIDE (etext = .);
132  .init    .  : { KEEP(*(.init))    } > ram =0
133  .fini    .  : { KEEP(*(.fini))    } > ram =0
134  .ctors   .  : { KEEP(*(.ctors))    } > ram =0
135  .dtors   .  : { KEEP(*(.dtors))    } > ram =0
136  .rodata  .  : { *(.rodata*) KEEP (*(SORT(.rtemsroset.*))) *(.gnu.linkonce.r*) } > ram
137  .rodata1 .  : { *(.rodata1) } > ram
138  .tdata : {
139    __TLS_Data_begin = .;
140    *(.tdata .tdata.* .gnu.linkonce.td.*)
141    __TLS_Data_end = .;
142  } > ram
143  .tbss : {
144    __TLS_BSS_begin = .;
145    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
146    __TLS_BSS_end = .;
147  } > ram
148  __TLS_Data_size = __TLS_Data_end - __TLS_Data_begin;
149  __TLS_Data_begin = __TLS_Data_size != 0 ? __TLS_Data_begin : __TLS_BSS_begin;
150  __TLS_Data_end = __TLS_Data_size != 0 ? __TLS_Data_end : __TLS_BSS_begin;
151  __TLS_BSS_size = __TLS_BSS_end - __TLS_BSS_begin;
152  __TLS_Size = __TLS_BSS_end - __TLS_Data_begin;
153  __TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
154  /* Adjust the address for the data segment.  We want to adjust up to
155     the same address within the page on the next page up.  */
156  . = ALIGN(128) + (. & (128 - 1));
157  .data  .  :
158  {
159    *(.data*)
160    KEEP (*(SORT(.rtemsrwset.*)))
161    *(.gcc_exc*)
162    ___EH_FRAME_BEGIN__ = .;
163    *(.eh_fram*)
164    ___EH_FRAME_END__ = .;
165    LONG(0);
166    *(.gcc_except_table*)
167    *(.gnu.linkonce.d*)
168    CONSTRUCTORS
169  } > ram
170  .data1  . : { *(.data1) }
171  .got     .      : { *(.got.plt) *(.got) }
172  .dynamic .      : { *(.dynamic) }
173  /* We want the small data sections together, so single-instruction offsets
174     can access them all, and initialized data all before uninitialized, so
175     we can shorten the on-disk segment size.  */
176  .sdata   .  : { *(.sdata) }
177  _edata  =  .;
178  PROVIDE (edata = .);
179  __bss_start = .;
180  .sbss    .  : { *(.sbss*) *(.scommon) }
181  .bss     .  :
182  {
183   *(.dynbss)
184   *(.bss .bss* .gnu.linkonce.b*)
185   *(COMMON)
186  } > ram
187  _end = . ;
188  PROVIDE (end = .);
189
190  .noinit (NOLOAD) : {
191    *(SORT_BY_NAME (SORT_BY_ALIGNMENT (.noinit*)))
192  } > ram
193
194  .rtemsstackidle (NOLOAD) : {
195    *(SORT(.rtemsstack.idle*))
196  } > ram
197
198  _WorkAreaBase = . ;
199
200  .rtemsstack (NOLOAD) : {
201    *(SORT(.rtemsstack.*))
202  } > onchip_ram
203
204  /* Stabs debugging sections.  */
205  .stab 0 : { *(.stab) }
206  .stabstr 0 : { *(.stabstr) }
207  .stab.excl 0 : { *(.stab.excl) }
208  .stab.exclstr 0 : { *(.stab.exclstr) }
209  .stab.index 0 : { *(.stab.index) }
210  .stab.indexstr 0 : { *(.stab.indexstr) }
211  .comment 0 : { *(.comment) }
212  /* DWARF debug sections.
213     Symbols in the DWARF debugging sections are relative to the beginning
214     of the section so we begin them at 0.  */
215  /* DWARF 1 */
216  .debug          0 : { *(.debug) }
217  .line           0 : { *(.line) }
218  /* GNU DWARF 1 extensions */
219  .debug_srcinfo  0 : { *(.debug_srcinfo) }
220  .debug_sfnames  0 : { *(.debug_sfnames) }
221  /* DWARF 1.1 and DWARF 2 */
222  .debug_aranges  0 : { *(.debug_aranges) }
223  .debug_pubnames 0 : { *(.debug_pubnames) }
224  /* DWARF 2 */
225  .debug_info     0 : { *(.debug_info) }
226  .debug_abbrev   0 : { *(.debug_abbrev) }
227  .debug_line     0 : { *(.debug_line) }
228  .debug_frame    0 : { *(.debug_frame) }
229  .debug_str      0 : { *(.debug_str) }
230  .debug_loc      0 : { *(.debug_loc) }
231  .debug_macinfo  0 : { *(.debug_macinfo) }
232  /* SGI/MIPS DWARF 2 extensions */
233  .debug_weaknames 0 : { *(.debug_weaknames) }
234  .debug_funcnames 0 : { *(.debug_funcnames) }
235  .debug_typenames 0 : { *(.debug_typenames) }
236  .debug_varnames  0 : { *(.debug_varnames) }
237  /* These must appear regardless of  .  */
238}
Note: See TracBrowser for help on using the repository browser.