source: rtems/c/src/lib/libbsp/sh/gensh1/startup/linkcmds @ b618d8c

5
Last change on this file since b618d8c was b618d8c, checked in by Sebastian Huber <sebastian.huber@…>, on 09/16/15 at 05:13:58

Add RTEMS linker sets

Update #2408.

  • Property mode set to 100644
File size: 7.1 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)
31
32_RamBase = DEFINED(_RamBase) ? _RamBase : 0x0a040000;
33_RamSize = DEFINED(_RamSize) ? _RamSize : 512K;
34_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x0;
35
36MEMORY
37{
38  rom           : o = 0x00000000, l = 128k
39  onchip_peri   : o = 0x05000000, l = 512
40  ram           : o = 0x0A040000, l = 512k  /* enough to link all tests */
41
42  onchip_ram    : o = 0x0f000000, l = 8k
43}
44
45SECTIONS
46{
47  /* boot vector table */
48  .monvects 0x00000000 (NOLOAD): {
49    _monvects = . ;
50  } > rom
51
52  /* monitor play area */
53  .monram 0x0A040000 (NOLOAD) :
54  {
55  _ramstart = .;
56  } > ram
57
58  /* monitor vector table */
59  .vects   0x0A042000 (NOLOAD) : {
60    _vectab = . ;
61    *(.vects);
62  }
63
64  /* Read-only sections, merged into text segment: */
65
66  . = 0x0a044000 ;
67  .interp        : { *(.interp)         }
68  .hash          : { *(.hash)           }
69  .dynsym        : { *(.dynsym)         }
70  .dynstr        : { *(.dynstr)         }
71  .gnu.version   : { *(.gnu.version)    }
72  .gnu.version_d : { *(.gnu.version_d)  }
73  .gnu.version_r : { *(.gnu.version_r)  }
74  .rela.dyn       :
75    {
76      *(.rela.init)
77      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
78      *(.rela.fini)
79      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
80      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
81      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
82      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
83      *(.rela.ctors)
84      *(.rela.dtors)
85      *(.rela.got)
86      *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
87      *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
88      *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
89      *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
90      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
91    } >ram
92  .rel.text      :
93    { *(.rel.text) *(.rel.gnu.linkonce.t*) }
94  .rel.data      :
95    { *(.rel.data) *(.rel.gnu.linkonce.d*) }
96  .rel.rodata    :
97    { *(.rel.rodata*) *(.rel.gnu.linkonce.r*) }
98  .rel.got       : { *(.rel.got)                }
99  .rel.ctors     : { *(.rel.ctors)      }
100  .rel.dtors     : { *(.rel.dtors)      }
101  .rel.init      : { *(.rel.init)       }
102  .rel.fini      : { *(.rel.fini)       }
103  .rel.bss       : { *(.rel.bss)                }
104  .rel.plt       : { *(.rel.plt)                }
105  .plt           : { *(.plt)    }
106  .text   .      :
107  {
108    _start = .;
109    *(.text*)
110    *(.stub)
111
112    /*
113     * Special FreeBSD sysctl sections.
114     */
115    . = ALIGN (16);
116    __start_set_sysctl_set = .;
117    ___start_set_sysctl_set = .;
118    *(set_sysc*);   /* set_sysctl_* but name is truncated by SH-coff */
119    __stop_set_sysctl_set = ABSOLUTE(.);
120    ___stop_set_sysctl_set = ABSOLUTE(.);
121    *(set_doma*);   /* set_domain_* but name is truncated by SH-coff */
122    *(set_pseu*);   /* set_pseudo_* but name is truncated by SH-coff */
123
124    /* .gnu.warning sections are handled specially by elf32.em.  */
125    *(.gnu.warning)
126    *(.gnu.linkonce.t*)
127  } > ram
128  _etext = .;
129  PROVIDE (etext = .);
130  .init    .  : { KEEP(*(.init))    } > ram =0
131  .fini    .  : { KEEP(*(.fini))    } > ram =0
132  .ctors   .  : { KEEP(*(.ctors))    } > ram =0
133  .dtors   .  : { KEEP(*(.dtors))    } > ram =0
134  .rodata  .  : { *(.rodata*) KEEP (*(SORT(.rtemsroset.*))) *(.gnu.linkonce.r*) } > ram
135  .rodata1 .  : { *(.rodata1) } > ram
136  .tdata : {
137    __TLS_Data_begin = .;
138    *(.tdata .tdata.* .gnu.linkonce.td.*)
139    __TLS_Data_end = .;
140  } > ram
141  .tbss : {
142    __TLS_BSS_begin = .;
143    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
144    __TLS_BSS_end = .;
145  } > ram
146  __TLS_Data_size = __TLS_Data_end - __TLS_Data_begin;
147  __TLS_Data_begin = __TLS_Data_size != 0 ? __TLS_Data_begin : __TLS_BSS_begin;
148  __TLS_Data_end = __TLS_Data_size != 0 ? __TLS_Data_end : __TLS_BSS_begin;
149  __TLS_BSS_size = __TLS_BSS_end - __TLS_BSS_begin;
150  __TLS_Size = __TLS_BSS_end - __TLS_Data_begin;
151  __TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
152  /* Adjust the address for the data segment.  We want to adjust up to
153     the same address within the page on the next page up.  */
154  . = ALIGN(128) + (. & (128 - 1));
155  .data  .  :
156  {
157    *(.data*)
158    KEEP (*(SORT(.rtemsrwset.*)))
159    *(.gcc_exc*)
160    ___EH_FRAME_BEGIN__ = .;
161    *(.eh_fram*)
162    ___EH_FRAME_END__ = .;
163    LONG(0);
164    *(.gcc_except_table*)
165    *(.gnu.linkonce.d*)
166    CONSTRUCTORS
167  } > ram
168  .data1  . : { *(.data1) }
169  .got     .      : { *(.got.plt) *(.got) }
170  .dynamic .      : { *(.dynamic) }
171  /* We want the small data sections together, so single-instruction offsets
172     can access them all, and initialized data all before uninitialized, so
173     we can shorten the on-disk segment size.  */
174  .sdata   .  : { *(.sdata) }
175  _edata  =  .;
176  PROVIDE (edata = .);
177  __bss_start = .;
178  .sbss    .  : { *(.sbss*) *(.scommon) }
179  .bss     .  :
180  {
181   *(.dynbss)
182   *(.bss .bss* .gnu.linkonce.b*)
183   *(COMMON)
184  } > ram
185  _end = . ;
186  PROVIDE (end = .);
187
188  _WorkAreaBase = . ;
189
190  _CPU_Interrupt_stack_low  = 0x0f000000 ;
191  _CPU_Interrupt_stack_high = _CPU_Interrupt_stack_low + 4096 ;
192
193  /* Stabs debugging sections.  */
194  .stab 0 : { *(.stab) }
195  .stabstr 0 : { *(.stabstr) }
196  .stab.excl 0 : { *(.stab.excl) }
197  .stab.exclstr 0 : { *(.stab.exclstr) }
198  .stab.index 0 : { *(.stab.index) }
199  .stab.indexstr 0 : { *(.stab.indexstr) }
200  .comment 0 : { *(.comment) }
201  /* DWARF debug sections.
202     Symbols in the DWARF debugging sections are relative to the beginning
203     of the section so we begin them at 0.  */
204  /* DWARF 1 */
205  .debug          0 : { *(.debug) }
206  .line           0 : { *(.line) }
207  /* GNU DWARF 1 extensions */
208  .debug_srcinfo  0 : { *(.debug_srcinfo) }
209  .debug_sfnames  0 : { *(.debug_sfnames) }
210  /* DWARF 1.1 and DWARF 2 */
211  .debug_aranges  0 : { *(.debug_aranges) }
212  .debug_pubnames 0 : { *(.debug_pubnames) }
213  /* DWARF 2 */
214  .debug_info     0 : { *(.debug_info) }
215  .debug_abbrev   0 : { *(.debug_abbrev) }
216  .debug_line     0 : { *(.debug_line) }
217  .debug_frame    0 : { *(.debug_frame) }
218  .debug_str      0 : { *(.debug_str) }
219  .debug_loc      0 : { *(.debug_loc) }
220  .debug_macinfo  0 : { *(.debug_macinfo) }
221  /* SGI/MIPS DWARF 2 extensions */
222  .debug_weaknames 0 : { *(.debug_weaknames) }
223  .debug_funcnames 0 : { *(.debug_funcnames) }
224  .debug_typenames 0 : { *(.debug_typenames) }
225  .debug_varnames  0 : { *(.debug_varnames) }
226
227  stack : { _stack = .; *(.stack) } > onchip_ram
228  /* These must appear regardless of  .  */
229}
Note: See TracBrowser for help on using the repository browser.