1 | /* |
---|
2 | * This is an adapted linker script from egcs-1.0.1 |
---|
3 | * |
---|
4 | * Memory layout for an SH7045F with main memory in area 2 |
---|
5 | * This memory layout it very similar to that used for Hitachi's |
---|
6 | * EVB with CMON in FLASH |
---|
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 | * Modified to reflect SH7045F processor and EVB: |
---|
29 | * John M. Mills (jmills@tga.com) |
---|
30 | * TGA Technologies, Inc. |
---|
31 | * 100 Pinnacle Way, Suite 140 |
---|
32 | * Norcross, GA 30071 U.S.A. |
---|
33 | * |
---|
34 | * This modified file may be copied and distributed in accordance |
---|
35 | * the above-referenced license. It is provided for critique and |
---|
36 | * developmental purposes without any warranty nor representation |
---|
37 | * by the authors or by TGA Technologies. |
---|
38 | * |
---|
39 | * $Id$ |
---|
40 | */ |
---|
41 | |
---|
42 | OUTPUT_ARCH(sh) |
---|
43 | ENTRY(_start) |
---|
44 | |
---|
45 | /* These assignments load code into SH7045F EVB SRAM for monitor debugging */ |
---|
46 | |
---|
47 | MEMORY |
---|
48 | { |
---|
49 | rom : o = 0x00400000, l = 0x00040000 |
---|
50 | ram : o = 0x00440000, l = 0x00080000 |
---|
51 | onchip_peri : o = 0xFFFF8000, l = 0x00000800 |
---|
52 | onchip_ram : o = 0xFFFFF000, l = 0x00001000 |
---|
53 | } |
---|
54 | |
---|
55 | /* Sections are defined for RAM loading and monitor debugging */ |
---|
56 | SECTIONS |
---|
57 | { |
---|
58 | /* boot vector table */ |
---|
59 | .monvects 0x00400000 (NOLOAD): { |
---|
60 | _monvects = . ; |
---|
61 | } > rom |
---|
62 | |
---|
63 | /* monitor play area */ |
---|
64 | .monram 0x00440000 (NOLOAD) : |
---|
65 | { |
---|
66 | _ramstart = .; |
---|
67 | } > ram |
---|
68 | |
---|
69 | /* monitor vector table */ |
---|
70 | .vects 0x00442000 (NOLOAD) : { |
---|
71 | _vectab = . ; |
---|
72 | *(.vects); |
---|
73 | } |
---|
74 | |
---|
75 | /* Read-only sections, merged into text segment: */ |
---|
76 | |
---|
77 | . = 0x00444000 ; |
---|
78 | .interp : { *(.interp) } |
---|
79 | .hash : { *(.hash) } |
---|
80 | .dynsym : { *(.dynsym) } |
---|
81 | .dynstr : { *(.dynstr) } |
---|
82 | .gnu.version : { *(.gnu.version) } |
---|
83 | .gnu.version_d : { *(.gnu.version_d) } |
---|
84 | .gnu.version_r : { *(.gnu.version_r) } |
---|
85 | .rel.text : |
---|
86 | { *(.rel.text) *(.rel.gnu.linkonce.t*) } |
---|
87 | .rela.text : |
---|
88 | { *(.rela.text) *(.rela.gnu.linkonce.t*) } |
---|
89 | .rel.data : |
---|
90 | { *(.rel.data) *(.rel.gnu.linkonce.d*) } |
---|
91 | .rela.data : |
---|
92 | { *(.rela.data) *(.rela.gnu.linkonce.d*) } |
---|
93 | .rel.rodata : |
---|
94 | { *(.rel.rodata*) *(.rel.gnu.linkonce.r*) } |
---|
95 | .rela.rodata : |
---|
96 | { *(.rela.rodata) *(.rela.gnu.linkonce.r*) } |
---|
97 | .rel.got : { *(.rel.got) } |
---|
98 | .rela.got : { *(.rela.got) } |
---|
99 | .rel.ctors : { *(.rel.ctors) } |
---|
100 | .rela.ctors : { *(.rela.ctors) } |
---|
101 | .rel.dtors : { *(.rel.dtors) } |
---|
102 | .rela.dtors : { *(.rela.dtors) } |
---|
103 | .rel.init : { *(.rel.init) } |
---|
104 | .rela.init : { *(.rela.init) } |
---|
105 | .rel.fini : { *(.rel.fini) } |
---|
106 | .rela.fini : { *(.rela.fini) } |
---|
107 | .rel.bss : { *(.rel.bss) } |
---|
108 | .rela.bss : { *(.rela.bss) } |
---|
109 | .rel.plt : { *(.rel.plt) } |
---|
110 | .rela.plt : { *(.rela.plt) } |
---|
111 | .init : { *(.init) } =0 |
---|
112 | .plt : { *(.plt) } |
---|
113 | .text . : |
---|
114 | { |
---|
115 | *(.text) |
---|
116 | *(.stub) |
---|
117 | |
---|
118 | /* |
---|
119 | * Special FreeBSD sysctl sections. |
---|
120 | */ |
---|
121 | . = ALIGN (16); |
---|
122 | ___start_set_sysctl_set = .; |
---|
123 | *(set_sysc*); /* set_sysctl_* but name is truncated by SH-coff */ |
---|
124 | ___stop_set_sysctl_set = ABSOLUTE(.); |
---|
125 | *(set_doma*); /* set_domain_* but name is truncated by SH-coff */ |
---|
126 | *(set_pseudo_*); |
---|
127 | |
---|
128 | /* .gnu.warning sections are handled specially by elf32.em. */ |
---|
129 | *(.gnu.warning) |
---|
130 | *(.gnu.linkonce.t*) |
---|
131 | } > ram |
---|
132 | _etext = .; |
---|
133 | PROVIDE (etext = .); |
---|
134 | .fini . : { *(.fini) } =0 |
---|
135 | .rodata . : { *(.rodata) *(.gnu.linkonce.r*) } |
---|
136 | .rodata1 . : { *(.rodata1) } |
---|
137 | /* Adjust the address for the data segment. We want to adjust up to |
---|
138 | the same address within the page on the next page up. */ |
---|
139 | . = ALIGN(128) + (. & (128 - 1)); |
---|
140 | .data . : |
---|
141 | { |
---|
142 | *(.data) |
---|
143 | *(.gcc_exc*) |
---|
144 | ___EH_FRAME_BEGIN__ = .; |
---|
145 | *(.eh_fram*) |
---|
146 | ___EH_FRAME_END__ = .; |
---|
147 | LONG(0); |
---|
148 | *(.gcc_except_table) |
---|
149 | *(.gnu.linkonce.d*) |
---|
150 | CONSTRUCTORS |
---|
151 | } > ram |
---|
152 | .data1 . : { *(.data1) } |
---|
153 | .ctors . : |
---|
154 | { |
---|
155 | ___ctors = .; |
---|
156 | *(.ctors) |
---|
157 | ___ctors_end = .; |
---|
158 | } |
---|
159 | .dtors . : |
---|
160 | { |
---|
161 | ___dtors = .; |
---|
162 | *(.dtors) |
---|
163 | ___dtors_end = .; |
---|
164 | } |
---|
165 | .got . : { *(.got.plt) *(.got) } |
---|
166 | .dynamic . : { *(.dynamic) } |
---|
167 | /* We want the small data sections together, so single-instruction offsets |
---|
168 | can access them all, and initialized data all before uninitialized, so |
---|
169 | we can shorten the on-disk segment size. */ |
---|
170 | .sdata . : { *(.sdata) } |
---|
171 | _edata = .; |
---|
172 | PROVIDE (edata = .); |
---|
173 | __bss_start = .; |
---|
174 | .sbss . : { *(.sbss) *(.scommon) } |
---|
175 | .bss . : |
---|
176 | { |
---|
177 | *(.dynbss) |
---|
178 | *(.bss) |
---|
179 | *(COMMON) |
---|
180 | } > ram |
---|
181 | _end = . ; |
---|
182 | PROVIDE (end = .); |
---|
183 | |
---|
184 | _HeapStart = . ; |
---|
185 | . = . + 1024 * 20 ; |
---|
186 | PROVIDE( _HeapEnd = . ); |
---|
187 | |
---|
188 | _WorkSpaceStart = . ; |
---|
189 | . = 0x00480000 ; |
---|
190 | PROVIDE(_WorkSpaceEnd = .); |
---|
191 | |
---|
192 | _CPU_Interrupt_stack_low = 0xFFFFF000 ; |
---|
193 | _CPU_Interrupt_stack_high = _CPU_Interrupt_stack_low + 4096 ; |
---|
194 | |
---|
195 | /* Stabs debugging sections. */ |
---|
196 | .stab 0 : { *(.stab) } |
---|
197 | .stabstr 0 : { *(.stabstr) } |
---|
198 | .stab.excl 0 : { *(.stab.excl) } |
---|
199 | .stab.exclstr 0 : { *(.stab.exclstr) } |
---|
200 | .stab.index 0 : { *(.stab.index) } |
---|
201 | .stab.indexstr 0 : { *(.stab.indexstr) } |
---|
202 | .comment 0 : { *(.comment) } |
---|
203 | /* DWARF debug sections. |
---|
204 | Symbols in the DWARF debugging sections are relative to the beginning |
---|
205 | of the section so we begin them at 0. */ |
---|
206 | /* DWARF 1 */ |
---|
207 | .debug 0 : { *(.debug) } |
---|
208 | .line 0 : { *(.line) } |
---|
209 | /* GNU DWARF 1 extensions */ |
---|
210 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
---|
211 | .debug_sfnames 0 : { *(.debug_sfnames) } |
---|
212 | /* DWARF 1.1 and DWARF 2 */ |
---|
213 | .debug_aranges 0 : { *(.debug_aranges) } |
---|
214 | .debug_pubnames 0 : { *(.debug_pubnames) } |
---|
215 | /* DWARF 2 */ |
---|
216 | .debug_info 0 : { *(.debug_info) } |
---|
217 | .debug_abbrev 0 : { *(.debug_abbrev) } |
---|
218 | .debug_line 0 : { *(.debug_line) } |
---|
219 | .debug_frame 0 : { *(.debug_frame) } |
---|
220 | .debug_str 0 : { *(.debug_str) } |
---|
221 | .debug_loc 0 : { *(.debug_loc) } |
---|
222 | .debug_macinfo 0 : { *(.debug_macinfo) } |
---|
223 | /* SGI/MIPS DWARF 2 extensions */ |
---|
224 | .debug_weaknames 0 : { *(.debug_weaknames) } |
---|
225 | .debug_funcnames 0 : { *(.debug_funcnames) } |
---|
226 | .debug_typenames 0 : { *(.debug_typenames) } |
---|
227 | .debug_varnames 0 : { *(.debug_varnames) } |
---|
228 | |
---|
229 | .stack 0xFFFFFEC0 : { _stack = .; *(.stack) } > onchip_ram |
---|
230 | /* These must appear regardless of . */ |
---|
231 | } |
---|