1 | /* |
---|
2 | * Memory layout for SH4 GNU simulator. |
---|
3 | * |
---|
4 | * Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia |
---|
5 | * Author: Victor V. Vengerov <vvv@oktet.ru> |
---|
6 | * |
---|
7 | * This program is distributed in the hope that it will be useful, |
---|
8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
---|
10 | * |
---|
11 | * |
---|
12 | * COPYRIGHT (c) 1998-2001. |
---|
13 | * On-Line Applications Research Corporation (OAR). |
---|
14 | * |
---|
15 | * The license and distribution terms for this file may be |
---|
16 | * found in the file LICENSE in this distribution or at |
---|
17 | * http://www.rtems.com/license/LICENSE. |
---|
18 | * |
---|
19 | * $Id$ |
---|
20 | */ |
---|
21 | |
---|
22 | /* OUTPUT_FORMAT("coff-shl") */ |
---|
23 | OUTPUT_FORMAT("elf32-shl") |
---|
24 | OUTPUT_ARCH(sh) |
---|
25 | ENTRY(_start) |
---|
26 | |
---|
27 | _HeapSize = DEFINED(_HeapSize) ? _HeapSize : (512 * 1024); |
---|
28 | _WorkspaceSize = DEFINED(_WorkspaceSize) ? _WorkspaceSize : (1024 * 1024); |
---|
29 | |
---|
30 | /* These assignments load code into SH7045F EVB SRAM for monitor debugging */ |
---|
31 | |
---|
32 | MEMORY |
---|
33 | { |
---|
34 | ram : o = 0x00000000, l = 0x01000000 |
---|
35 | } |
---|
36 | |
---|
37 | /* Sections are defined for RAM loading and monitor debugging */ |
---|
38 | SECTIONS |
---|
39 | { |
---|
40 | |
---|
41 | /* Read-only sections, merged into text segment: */ |
---|
42 | |
---|
43 | . = 0x00004000 ; |
---|
44 | .interp : { *(.interp) } |
---|
45 | .hash : { *(.hash) } |
---|
46 | .dynsym : { *(.dynsym) } |
---|
47 | .dynstr : { *(.dynstr) } |
---|
48 | .gnu.version : { *(.gnu.version) } |
---|
49 | .gnu.version_d : { *(.gnu.version_d) } |
---|
50 | .gnu.version_r : { *(.gnu.version_r) } |
---|
51 | .rela.dyn : |
---|
52 | { |
---|
53 | *(.rela.init) |
---|
54 | *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) |
---|
55 | *(.rela.fini) |
---|
56 | *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) |
---|
57 | *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) |
---|
58 | *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) |
---|
59 | *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) |
---|
60 | *(.rela.ctors) |
---|
61 | *(.rela.dtors) |
---|
62 | *(.rela.got) |
---|
63 | *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) |
---|
64 | *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) |
---|
65 | *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) |
---|
66 | *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) |
---|
67 | *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) |
---|
68 | } >ram |
---|
69 | .rel.text : |
---|
70 | { *(.rel.text) *(.rel.gnu.linkonce.t*) } |
---|
71 | .rel.data : |
---|
72 | { *(.rel.data) *(.rel.gnu.linkonce.d*) } |
---|
73 | .rel.rodata : |
---|
74 | { *(.rel.rodata) *(.rel.gnu.linkonce.r*) } |
---|
75 | .rel.got : { *(.rel.got) } |
---|
76 | .rel.ctors : { *(.rel.ctors) } |
---|
77 | .rel.dtors : { *(.rel.dtors) } |
---|
78 | .rel.init : { *(.rel.init) } |
---|
79 | .rel.fini : { *(.rel.fini) } |
---|
80 | .rel.bss : { *(.rel.bss) } |
---|
81 | .rel.plt : { *(.rel.plt) } |
---|
82 | .init : { *(.init) } =0 |
---|
83 | .plt : { *(.plt) } |
---|
84 | .text . : |
---|
85 | { |
---|
86 | *(.text*) |
---|
87 | *(.stub) |
---|
88 | |
---|
89 | /* |
---|
90 | * Special FreeBSD sysctl sections. |
---|
91 | */ |
---|
92 | . = ALIGN (16); |
---|
93 | ___start_set_sysctl_set = .; |
---|
94 | *(set_sysc*); /* set_sysctl_* but name is truncated by SH-coff */ |
---|
95 | ___stop_set_sysctl_set = ABSOLUTE(.); |
---|
96 | *(set_doma*); /* set_domain_* but name is truncated by SH-coff */ |
---|
97 | *(set_pseudo_*); |
---|
98 | |
---|
99 | /* .gnu.warning sections are handled specially by elf32.em. */ |
---|
100 | *(.gnu.warning) |
---|
101 | *(.gnu.linkonce.t*) |
---|
102 | } > ram |
---|
103 | _etext = .; |
---|
104 | PROVIDE (etext = .); |
---|
105 | .fini . : { *(.fini) } =0 |
---|
106 | .rodata . : { *(.rodata) *(.gnu.linkonce.r*) } |
---|
107 | .rodata1 . : { *(.rodata1) } |
---|
108 | /* Adjust the address for the data segment. We want to adjust up to |
---|
109 | the same address within the page on the next page up. */ |
---|
110 | . = ALIGN(128) + (. & (128 - 1)); |
---|
111 | .data . : |
---|
112 | { |
---|
113 | *(.data) |
---|
114 | *(.gcc_exc) |
---|
115 | ___EH_FRAME_BEGIN__ = .; |
---|
116 | *(.eh_fram*) |
---|
117 | ___EH_FRAME_END__ = .; |
---|
118 | LONG(0); |
---|
119 | *(.gcc_except_table*) |
---|
120 | *(.gnu.linkonce.d*) |
---|
121 | CONSTRUCTORS |
---|
122 | } > ram |
---|
123 | .data1 . : { *(.data1) } |
---|
124 | .ctors . : |
---|
125 | { |
---|
126 | ___ctors = .; |
---|
127 | *(.ctors) |
---|
128 | ___ctors_end = .; |
---|
129 | } |
---|
130 | .dtors . : |
---|
131 | { |
---|
132 | ___dtors = .; |
---|
133 | *(.dtors) |
---|
134 | ___dtors_end = .; |
---|
135 | } |
---|
136 | .got . : { *(.got.plt) *(.got) } |
---|
137 | .dynamic . : { *(.dynamic) } |
---|
138 | /* We want the small data sections together, so single-instruction offsets |
---|
139 | can access them all, and initialized data all before uninitialized, so |
---|
140 | we can shorten the on-disk segment size. */ |
---|
141 | .sdata . : { *(.sdata) } |
---|
142 | _edata = .; |
---|
143 | PROVIDE (edata = .); |
---|
144 | __bss_start = .; |
---|
145 | .sbss . : { *(.sbss*) *(.scommon) } |
---|
146 | .bss . : |
---|
147 | { |
---|
148 | *(.dynbss) |
---|
149 | *(.bss .bss* .gnu.linkonce.b*) |
---|
150 | *(COMMON) |
---|
151 | } > ram |
---|
152 | _end = . ; |
---|
153 | PROVIDE (end = .); |
---|
154 | |
---|
155 | . = ALIGN(16); |
---|
156 | _HeapStart = . ; |
---|
157 | . = . + _HeapSize ; |
---|
158 | PROVIDE( _HeapEnd = . ); |
---|
159 | |
---|
160 | . = ALIGN(16); |
---|
161 | _WorkSpaceStart = . ; |
---|
162 | . = . + _WorkspaceSize ; |
---|
163 | PROVIDE(_WorkSpaceEnd = .); |
---|
164 | |
---|
165 | . = ALIGN(16); |
---|
166 | .stack . : { |
---|
167 | . = . + 4096; |
---|
168 | } |
---|
169 | |
---|
170 | . = ALIGN(16); |
---|
171 | _CPU_Interrupt_stack_low = . ; |
---|
172 | _CPU_Interrupt_stack_high = _CPU_Interrupt_stack_low + 4096 ; |
---|
173 | |
---|
174 | /* Stabs debugging sections. */ |
---|
175 | .stab 0 : { *(.stab) } |
---|
176 | .stabstr 0 : { *(.stabstr) } |
---|
177 | .stab.excl 0 : { *(.stab.excl) } |
---|
178 | .stab.exclstr 0 : { *(.stab.exclstr) } |
---|
179 | .stab.index 0 : { *(.stab.index) } |
---|
180 | .stab.indexstr 0 : { *(.stab.indexstr) } |
---|
181 | .comment 0 : { *(.comment) } |
---|
182 | /* DWARF debug sections. |
---|
183 | Symbols in the DWARF debugging sections are relative to the beginning |
---|
184 | of the section so we begin them at 0. */ |
---|
185 | /* DWARF 1 */ |
---|
186 | .debug 0 : { *(.debug) } |
---|
187 | .line 0 : { *(.line) } |
---|
188 | /* GNU DWARF 1 extensions */ |
---|
189 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
---|
190 | .debug_sfnames 0 : { *(.debug_sfnames) } |
---|
191 | /* DWARF 1.1 and DWARF 2 */ |
---|
192 | .debug_aranges 0 : { *(.debug_aranges) } |
---|
193 | .debug_pubnames 0 : { *(.debug_pubnames) } |
---|
194 | /* DWARF 2 */ |
---|
195 | .debug_info 0 : { *(.debug_info) } |
---|
196 | .debug_abbrev 0 : { *(.debug_abbrev) } |
---|
197 | .debug_line 0 : { *(.debug_line) } |
---|
198 | .debug_frame 0 : { *(.debug_frame) } |
---|
199 | .debug_str 0 : { *(.debug_str) } |
---|
200 | .debug_loc 0 : { *(.debug_loc) } |
---|
201 | .debug_macinfo 0 : { *(.debug_macinfo) } |
---|
202 | /* SGI/MIPS DWARF 2 extensions */ |
---|
203 | .debug_weaknames 0 : { *(.debug_weaknames) } |
---|
204 | .debug_funcnames 0 : { *(.debug_funcnames) } |
---|
205 | .debug_typenames 0 : { *(.debug_typenames) } |
---|
206 | .debug_varnames 0 : { *(.debug_varnames) } |
---|
207 | |
---|
208 | } |
---|