1 | /* |
---|
2 | * COPYRIGHT (c) 1989-2008. |
---|
3 | * On-Line Applications Research Corporation (OAR). |
---|
4 | * |
---|
5 | * The license and distribution terms for this file may be |
---|
6 | * found in the file LICENSE in this distribution or at |
---|
7 | * http://www.rtems.com/license/LICENSE. |
---|
8 | */ |
---|
9 | |
---|
10 | OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc") |
---|
11 | OUTPUT_ARCH(powerpc) |
---|
12 | ENTRY(_start) |
---|
13 | /* Do we need any of these for elf? |
---|
14 | __DYNAMIC = 0; */ |
---|
15 | PROVIDE (PSIM_INSTRUCTIONS_PER_MICROSECOND = 10000); |
---|
16 | |
---|
17 | RamBase = DEFINED(RamBase) ? RamBase : 0x0; |
---|
18 | /* |
---|
19 | * make sure device tree (property /openprom/options/oea-memory-size) |
---|
20 | * provides at least 'RamSize'. |
---|
21 | * Also, the BATs must at map at least 'RamSize' (currently, they |
---|
22 | * map 32M -- see startup/bspstart.c). |
---|
23 | * Furthermore, the RAM region must be large enough (there is no |
---|
24 | * disadvantage in making that one very large as long as it doesn't |
---|
25 | * overlap another memory area). |
---|
26 | * |
---|
27 | */ |
---|
28 | RamSize = DEFINED(RamSize) ? RamSize : 16M; |
---|
29 | |
---|
30 | MEMORY |
---|
31 | { |
---|
32 | RAM : ORIGIN = 0, LENGTH = 32M |
---|
33 | PSIM_REGS : ORIGIN = 0x0c000000, LENGTH = 16M |
---|
34 | VECTORS : ORIGIN = 0xFFF00000, LENGTH = 0x20000 |
---|
35 | } |
---|
36 | |
---|
37 | SECTIONS |
---|
38 | { |
---|
39 | .entry_point_section : |
---|
40 | { |
---|
41 | *(.entry_point_section) |
---|
42 | } > VECTORS |
---|
43 | |
---|
44 | /* |
---|
45 | * BSP: PSIM Register Block |
---|
46 | */ |
---|
47 | .psim_regs (NOLOAD) : { |
---|
48 | psim_reg*(.text) |
---|
49 | psim_reg*(.data) |
---|
50 | psim_reg*(.bss) |
---|
51 | psim_reg*(COMMON) |
---|
52 | } > PSIM_REGS |
---|
53 | |
---|
54 | /* Read-only sections, merged into text segment: */ |
---|
55 | /* . = 0x40000 + SIZEOF_HEADERS; */ |
---|
56 | . = 0x4000; |
---|
57 | .interp : { *(.interp) } |
---|
58 | .hash : { *(.hash) } |
---|
59 | .dynsym : { *(.dynsym) } |
---|
60 | .dynstr : { *(.dynstr) } |
---|
61 | .gnu.version : { *(.gnu.version) } |
---|
62 | .gnu.version_d : { *(.gnu.version_d) } |
---|
63 | .gnu.version_r : { *(.gnu.version_r) } |
---|
64 | .text : |
---|
65 | { |
---|
66 | *(.text*) |
---|
67 | *(.gnu.linkonce.t.*) |
---|
68 | *(.descriptors) |
---|
69 | *(.eh_frame_hdr*) |
---|
70 | *(.eh_frame*) |
---|
71 | |
---|
72 | /* .gnu.warning sections are handled specially by elf32.em. */ |
---|
73 | *(.gnu.warning) |
---|
74 | } >RAM |
---|
75 | .robsdsets : { |
---|
76 | /* Special FreeBSD linker set sections */ |
---|
77 | __start_set_sysctl_set = .; |
---|
78 | *(set_sysctl_*); |
---|
79 | __stop_set_sysctl_set = .; |
---|
80 | *(set_domain_*); |
---|
81 | *(set_pseudo_*); |
---|
82 | _bsd__start_set_modmetadata_set = .; |
---|
83 | *(_bsd_set_modmetadata_set); |
---|
84 | _bsd__stop_set_modmetadata_set = .; |
---|
85 | _bsd__start_set_sysctl_set = .; |
---|
86 | *(_bsd_set_sysctl_set); |
---|
87 | _bsd__stop_set_sysctl_set = .; |
---|
88 | _bsd__start_set_sysinit_set = .; |
---|
89 | *(_bsd_set_sysinit_*); |
---|
90 | _bsd__stop_set_sysinit_set = .; |
---|
91 | |
---|
92 | bsp_section_rodata_end = .; |
---|
93 | } > RAM |
---|
94 | .init : |
---|
95 | { |
---|
96 | KEEP (*(.init)) |
---|
97 | } >RAM =0 |
---|
98 | |
---|
99 | .rel.dyn : |
---|
100 | { |
---|
101 | *(.rel.init) |
---|
102 | *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) |
---|
103 | *(.rel.fini) |
---|
104 | *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) |
---|
105 | *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) |
---|
106 | *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) |
---|
107 | *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) |
---|
108 | *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) |
---|
109 | *(.rel.ctors) |
---|
110 | *(.rel.dtors) |
---|
111 | *(.rel.got) |
---|
112 | *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) |
---|
113 | *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) |
---|
114 | *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) |
---|
115 | *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) |
---|
116 | *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) |
---|
117 | } >RAM |
---|
118 | .rela.dyn : |
---|
119 | { |
---|
120 | *(.rela.init) |
---|
121 | *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) |
---|
122 | *(.rela.fini) |
---|
123 | *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) |
---|
124 | *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) |
---|
125 | *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) |
---|
126 | *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) |
---|
127 | *(.rela.ctors) |
---|
128 | *(.rela.dtors) |
---|
129 | *(.rela.got) |
---|
130 | *(.rela.got1) |
---|
131 | *(.rela.got2) |
---|
132 | *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) |
---|
133 | *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) |
---|
134 | *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) |
---|
135 | *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) |
---|
136 | *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) |
---|
137 | } >RAM |
---|
138 | .rel.plt : { *(.rel.plt) } |
---|
139 | .rela.plt : { *(.rela.plt) } |
---|
140 | |
---|
141 | .fini : |
---|
142 | { |
---|
143 | _fini = .; |
---|
144 | KEEP (*(.fini)) |
---|
145 | } >RAM =0 |
---|
146 | .rodata : { *(.rodata*) *(.gnu.linkonce.r*) } >RAM |
---|
147 | .rodata1 : { *(.rodata1) } >RAM |
---|
148 | PROVIDE (__FRAME_BEGIN__ = .); |
---|
149 | PROVIDE (__FRAME_END__ = .); |
---|
150 | PROVIDE (_etext = .); |
---|
151 | PROVIDE (etext = .); |
---|
152 | _SDA2_BASE_ = __SDATA2_START__ + 0x8000; |
---|
153 | .sdata2 : { *(.sdata2) *(.gnu.linkonce.s2.*) } >RAM |
---|
154 | .sbss2 : { *(.sbss2) *(.gnu.linkonce.sb2.*) } >RAM |
---|
155 | PROVIDE (__SBSS2_END__ = .); |
---|
156 | /* Adjust the address for the data segment. We want to adjust up to |
---|
157 | the same address within the page on the next page up. It would |
---|
158 | be more correct to do this: |
---|
159 | . = ALIGN(0x40000) + (ALIGN(8) & (0x40000 - 1)); |
---|
160 | The current expression does not correctly handle the case of a |
---|
161 | text segment ending precisely at the end of a page; it causes the |
---|
162 | data segment to skip a page. The above expression does not have |
---|
163 | this problem, but it will currently (2/95) cause BFD to allocate |
---|
164 | a single segment, combining both text and data, for this case. |
---|
165 | This will prevent the text segment from being shared among |
---|
166 | multiple executions of the program; I think that is more |
---|
167 | important than losing a page of the virtual address space (note |
---|
168 | that no actual memory is lost; the page which is skipped can not |
---|
169 | be referenced). */ |
---|
170 | /* . = ALIGN(8) + 0x40000; */ |
---|
171 | .data : |
---|
172 | { |
---|
173 | *(.data .data.* .gnu.linkonce.d.*) |
---|
174 | SORT(CONSTRUCTORS) |
---|
175 | } >RAM |
---|
176 | PROVIDE (__EXCEPT_START__ = .); |
---|
177 | .gcc_except_table : { *(.gcc_except_table*) } >RAM |
---|
178 | PROVIDE (__EXCEPT_END__ = .); |
---|
179 | |
---|
180 | .data1 : { *(.data1) } >RAM |
---|
181 | .got1 : { *(.got1) } >RAM |
---|
182 | .dynamic : { *(.dynamic) } >RAM |
---|
183 | /* Put .ctors and .dtors next to the .got2 section, so that the pointers |
---|
184 | get relocated with -mrelocatable. Also put in the .fixup pointers. |
---|
185 | The current compiler no longer needs this, but keep it around for 2.7.2 */ |
---|
186 | PROVIDE (__GOT2_START__ = .); |
---|
187 | PROVIDE (_GOT2_START_ = .); |
---|
188 | .got2 : { *(.got2) } >RAM |
---|
189 | PROVIDE (__GOT2_END__ = .); |
---|
190 | PROVIDE (_GOT2_END_ = .); |
---|
191 | |
---|
192 | PROVIDE (__CTOR_LIST__ = .); |
---|
193 | .ctors : { *(.ctors) } >RAM |
---|
194 | PROVIDE (__CTOR_END__ = .); |
---|
195 | |
---|
196 | PROVIDE (__DTOR_LIST__ = .); |
---|
197 | .dtors : { *(.dtors) } >RAM |
---|
198 | PROVIDE (__DTOR_END__ = .); |
---|
199 | |
---|
200 | PROVIDE (__FIXUP_START__ = .); |
---|
201 | PROVIDE (_FIXUP_START_ = .); |
---|
202 | .fixup : { *(.fixup) } >RAM |
---|
203 | PROVIDE (_FIXUP_END_ = .); |
---|
204 | PROVIDE (__FIXUP_END__ = .); |
---|
205 | |
---|
206 | .jcr : { KEEP (*(.jcr)) } > RAM |
---|
207 | |
---|
208 | PROVIDE (__GOT_START__ = .); |
---|
209 | PROVIDE (_GOT_START_ = .); |
---|
210 | s.got = .; |
---|
211 | .got : { *(.got) } >RAM |
---|
212 | .got.plt : { *(.got.plt) } >RAM |
---|
213 | PROVIDE (_GOT_END_ = .); |
---|
214 | PROVIDE (__GOT_END__ = .); |
---|
215 | |
---|
216 | /* We want the small data sections together, so single-instruction offsets |
---|
217 | can access them all, and initialized data all before uninitialized, so |
---|
218 | we can shorten the on-disk segment size. */ |
---|
219 | _SDA_BASE_ = __SDATA_START__ + 0x8000; |
---|
220 | .sdata : { *(.sdata*) *(.gnu.linkonce.s.*) } >RAM |
---|
221 | _edata = .; |
---|
222 | PROVIDE (edata = .); |
---|
223 | |
---|
224 | PROVIDE (RAM_END = 32M); |
---|
225 | .sbss : |
---|
226 | { |
---|
227 | PROVIDE (__sbss_start = .); |
---|
228 | *(.dynsbss) |
---|
229 | *(.sbss* .gnu.linkonce.sb.*) |
---|
230 | PROVIDE (__sbss_end = .); |
---|
231 | } >RAM |
---|
232 | PROVIDE (__SBSS_END__ = .); |
---|
233 | |
---|
234 | .bss : |
---|
235 | { |
---|
236 | PROVIDE (__bss_start = .); |
---|
237 | *(.dynbss) |
---|
238 | *(.bss .bss* .gnu.linkonce.b*) |
---|
239 | *(COMMON) |
---|
240 | } >RAM |
---|
241 | . = ALIGN(16); |
---|
242 | . += 0x1000; |
---|
243 | PROVIDE(__stack = .); |
---|
244 | __rtems_end = . ; |
---|
245 | . = ALIGN(8) + 0x8000; |
---|
246 | PROVIDE(_end = .); |
---|
247 | PROVIDE(end = .); |
---|
248 | |
---|
249 | /* These are needed for ELF backends which have not yet been |
---|
250 | converted to the new style linker. */ |
---|
251 | .stab 0 : { *(.stab) } |
---|
252 | .stabstr 0 : { *(.stabstr) } |
---|
253 | /* DWARF debug sections. |
---|
254 | Symbols in the DWARF debugging sections are relative to the beginning |
---|
255 | of the section so we begin them at 0. */ |
---|
256 | /* DWARF 1 */ |
---|
257 | .debug 0 : { *(.debug) } |
---|
258 | .line 0 : { *(.line) } |
---|
259 | /* GNU DWARF 1 extensions */ |
---|
260 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
---|
261 | .debug_sfnames 0 : { *(.debug_sfnames) } |
---|
262 | /* DWARF 1.1 and DWARF 2 */ |
---|
263 | .debug_aranges 0 : { *(.debug_aranges) } |
---|
264 | .debug_pubnames 0 : { *(.debug_pubnames) } |
---|
265 | /* DWARF 2 */ |
---|
266 | .debug_info 0 : { *(.debug_info) } |
---|
267 | .debug_abbrev 0 : { *(.debug_abbrev) } |
---|
268 | .debug_line 0 : { *(.debug_line) } |
---|
269 | .debug_frame 0 : { *(.debug_frame) } |
---|
270 | .debug_str 0 : { *(.debug_str) } |
---|
271 | .debug_loc 0 : { *(.debug_loc) } |
---|
272 | .debug_macinfo 0 : { *(.debug_macinfo) } |
---|
273 | /* SGI/MIPS DWARF 2 extensions */ |
---|
274 | .debug_weaknames 0 : { *(.debug_weaknames) } |
---|
275 | .debug_funcnames 0 : { *(.debug_funcnames) } |
---|
276 | .debug_typenames 0 : { *(.debug_typenames) } |
---|
277 | .debug_varnames 0 : { *(.debug_varnames) } |
---|
278 | /* These must appear regardless of . */ |
---|
279 | } |
---|