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

4.104.114.84.95
Last change on this file since b98fe82 was b98fe82, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/07 at 20:34:08

2007-05-03 Joel Sherrill <joel@…>

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