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.OARcorp.com/rtems/license.html. |
---|
27 | * |
---|
28 | * $Id$ |
---|
29 | */ |
---|
30 | |
---|
31 | OUTPUT_ARCH(sh) |
---|
32 | ENTRY(_start) |
---|
33 | |
---|
34 | MEMORY |
---|
35 | { |
---|
36 | rom : o = 0x00000000, l = 128k |
---|
37 | onchip_peri : o = 0x05000000, l = 512 |
---|
38 | ram : o = 0x0A040000, l = 256k |
---|
39 | |
---|
40 | onchip_ram : o = 0x0f000000, l = 8k |
---|
41 | } |
---|
42 | |
---|
43 | SECTIONS |
---|
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 | .rel.text : |
---|
73 | { *(.rel.text) *(.rel.gnu.linkonce.t*) } |
---|
74 | .rela.text : |
---|
75 | { *(.rela.text) *(.rela.gnu.linkonce.t*) } |
---|
76 | .rel.data : |
---|
77 | { *(.rel.data) *(.rel.gnu.linkonce.d*) } |
---|
78 | .rela.data : |
---|
79 | { *(.rela.data) *(.rela.gnu.linkonce.d*) } |
---|
80 | .rel.rodata : |
---|
81 | { *(.rel.rodata*) *(.rel.gnu.linkonce.r*) } |
---|
82 | .rela.rodata : |
---|
83 | { *(.rela.rodata) *(.rela.gnu.linkonce.r*) } |
---|
84 | .rel.got : { *(.rel.got) } |
---|
85 | .rela.got : { *(.rela.got) } |
---|
86 | .rel.ctors : { *(.rel.ctors) } |
---|
87 | .rela.ctors : { *(.rela.ctors) } |
---|
88 | .rel.dtors : { *(.rel.dtors) } |
---|
89 | .rela.dtors : { *(.rela.dtors) } |
---|
90 | .rel.init : { *(.rel.init) } |
---|
91 | .rela.init : { *(.rela.init) } |
---|
92 | .rel.fini : { *(.rel.fini) } |
---|
93 | .rela.fini : { *(.rela.fini) } |
---|
94 | .rel.bss : { *(.rel.bss) } |
---|
95 | .rela.bss : { *(.rela.bss) } |
---|
96 | .rel.plt : { *(.rel.plt) } |
---|
97 | .rela.plt : { *(.rela.plt) } |
---|
98 | .init : { *(.init) } =0 |
---|
99 | .plt : { *(.plt) } |
---|
100 | .text . : |
---|
101 | { |
---|
102 | *(.text) |
---|
103 | *(.stub) |
---|
104 | |
---|
105 | /* |
---|
106 | * Special FreeBSD sysctl sections. |
---|
107 | */ |
---|
108 | . = ALIGN (16); |
---|
109 | __start_set_sysctl_set = .; |
---|
110 | *(set_sysctl_*); |
---|
111 | __stop_set_sysctl_set = ABSOLUTE(.); |
---|
112 | *(set_domain_*); |
---|
113 | *(set_pseudo_*); |
---|
114 | |
---|
115 | /* .gnu.warning sections are handled specially by elf32.em. */ |
---|
116 | *(.gnu.warning) |
---|
117 | *(.gnu.linkonce.t*) |
---|
118 | } > ram |
---|
119 | _etext = .; |
---|
120 | PROVIDE (etext = .); |
---|
121 | .fini . : { *(.fini) } =0 |
---|
122 | .rodata . : { *(.rodata) *(.gnu.linkonce.r*) } |
---|
123 | .rodata1 . : { *(.rodata1) } |
---|
124 | /* Adjust the address for the data segment. We want to adjust up to |
---|
125 | the same address within the page on the next page up. */ |
---|
126 | . = ALIGN(128) + (. & (128 - 1)); |
---|
127 | .data . : |
---|
128 | { |
---|
129 | *(.data) |
---|
130 | *(.gcc_exc*) |
---|
131 | ___EH_FRAME_BEGIN__ = .; |
---|
132 | *(.eh_fram*) |
---|
133 | ___EH_FRAME_END__ = .; |
---|
134 | LONG(0); |
---|
135 | *(.gcc_except_table) |
---|
136 | *(.gnu.linkonce.d*) |
---|
137 | CONSTRUCTORS |
---|
138 | } > ram |
---|
139 | .data1 . : { *(.data1) } |
---|
140 | .ctors . : |
---|
141 | { |
---|
142 | ___ctors = .; |
---|
143 | *(.ctors) |
---|
144 | ___ctors_end = .; |
---|
145 | } |
---|
146 | .dtors . : |
---|
147 | { |
---|
148 | ___dtors = .; |
---|
149 | *(.dtors) |
---|
150 | ___dtors_end = .; |
---|
151 | } |
---|
152 | .got . : { *(.got.plt) *(.got) } |
---|
153 | .dynamic . : { *(.dynamic) } |
---|
154 | /* We want the small data sections together, so single-instruction offsets |
---|
155 | can access them all, and initialized data all before uninitialized, so |
---|
156 | we can shorten the on-disk segment size. */ |
---|
157 | .sdata . : { *(.sdata) } |
---|
158 | _edata = .; |
---|
159 | PROVIDE (edata = .); |
---|
160 | __bss_start = .; |
---|
161 | .sbss . : { *(.sbss) *(.scommon) } |
---|
162 | .bss . : |
---|
163 | { |
---|
164 | *(.dynbss) |
---|
165 | *(.bss) |
---|
166 | *(COMMON) |
---|
167 | } > ram |
---|
168 | _end = . ; |
---|
169 | PROVIDE (end = .); |
---|
170 | |
---|
171 | _HeapStart = . ; |
---|
172 | . = . + 1024 * 20 ; |
---|
173 | PROVIDE( _HeapEnd = . ); |
---|
174 | |
---|
175 | _WorkSpaceStart = . ; |
---|
176 | . = 0x0a080000 ; |
---|
177 | PROVIDE(_WorkSpaceEnd = .); |
---|
178 | |
---|
179 | _CPU_Interrupt_stack_low = 0x0f000000 ; |
---|
180 | _CPU_Interrupt_stack_high = _CPU_Interrupt_stack_low + 4096 ; |
---|
181 | |
---|
182 | /* Stabs debugging sections. */ |
---|
183 | .stab 0 : { *(.stab) } |
---|
184 | .stabstr 0 : { *(.stabstr) } |
---|
185 | .stab.excl 0 : { *(.stab.excl) } |
---|
186 | .stab.exclstr 0 : { *(.stab.exclstr) } |
---|
187 | .stab.index 0 : { *(.stab.index) } |
---|
188 | .stab.indexstr 0 : { *(.stab.indexstr) } |
---|
189 | .comment 0 : { *(.comment) } |
---|
190 | /* DWARF debug sections. |
---|
191 | Symbols in the DWARF debugging sections are relative to the beginning |
---|
192 | of the section so we begin them at 0. */ |
---|
193 | /* DWARF 1 */ |
---|
194 | .debug 0 : { *(.debug) } |
---|
195 | .line 0 : { *(.line) } |
---|
196 | /* GNU DWARF 1 extensions */ |
---|
197 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
---|
198 | .debug_sfnames 0 : { *(.debug_sfnames) } |
---|
199 | /* DWARF 1.1 and DWARF 2 */ |
---|
200 | .debug_aranges 0 : { *(.debug_aranges) } |
---|
201 | .debug_pubnames 0 : { *(.debug_pubnames) } |
---|
202 | /* DWARF 2 */ |
---|
203 | .debug_info 0 : { *(.debug_info) } |
---|
204 | .debug_abbrev 0 : { *(.debug_abbrev) } |
---|
205 | .debug_line 0 : { *(.debug_line) } |
---|
206 | .debug_frame 0 : { *(.debug_frame) } |
---|
207 | .debug_str 0 : { *(.debug_str) } |
---|
208 | .debug_loc 0 : { *(.debug_loc) } |
---|
209 | .debug_macinfo 0 : { *(.debug_macinfo) } |
---|
210 | /* SGI/MIPS DWARF 2 extensions */ |
---|
211 | .debug_weaknames 0 : { *(.debug_weaknames) } |
---|
212 | .debug_funcnames 0 : { *(.debug_funcnames) } |
---|
213 | .debug_typenames 0 : { *(.debug_typenames) } |
---|
214 | .debug_varnames 0 : { *(.debug_varnames) } |
---|
215 | |
---|
216 | .stack 0x0f001ff0 : { _stack = .; *(.stack) } > onchip_ram |
---|
217 | /* These must appear regardless of . */ |
---|
218 | } |
---|