1 | OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", |
---|
2 | "elf32-powerpc") |
---|
3 | OUTPUT_ARCH(powerpc) |
---|
4 | ENTRY(_start) |
---|
5 | /* Do we need any of these for elf? |
---|
6 | __DYNAMIC = 0; */ |
---|
7 | PROVIDE (__stack = 0); |
---|
8 | MEMORY { |
---|
9 | VECTORS : ORIGIN = 0x0 , LENGTH = 0x3000 |
---|
10 | CODE : ORIGIN = 0x3000 , LENGTH = 32M - 0x3000 |
---|
11 | } |
---|
12 | SECTIONS |
---|
13 | { |
---|
14 | .entry_point_section : |
---|
15 | { |
---|
16 | *(.entry_point_section) |
---|
17 | } > VECTORS |
---|
18 | |
---|
19 | /* |
---|
20 | * This section is used only if NO_DYNAMIC_EXCEPTION_VECTOR_INSTALL |
---|
21 | * is defined in vectors/vectors.S |
---|
22 | */ |
---|
23 | .vectors : |
---|
24 | { |
---|
25 | *(.vectors) |
---|
26 | } > VECTORS |
---|
27 | |
---|
28 | /* Read-only sections, merged into text segment: */ |
---|
29 | .interp : { *(.interp) } > CODE |
---|
30 | .hash : { *(.hash) } > CODE |
---|
31 | .dynsym : { *(.dynsym) } > CODE |
---|
32 | .dynstr : { *(.dynstr) } > CODE |
---|
33 | .gnu.version : { *(.gnu.version) } > CODE |
---|
34 | .gnu.version_d : { *(.gnu.version_d) } > CODE |
---|
35 | .gnu.version_r : { *(.gnu.version_r) } > CODE |
---|
36 | .rela.text : |
---|
37 | { *(.rela.text) *(.rela.gnu.linkonce.t*) } > CODE |
---|
38 | .rela.data : |
---|
39 | { *(.rela.data) *(.rela.gnu.linkonce.d*) } > CODE |
---|
40 | .rela.rodata : |
---|
41 | { *(.rela.rodata*) *(.rela.gnu.linkonce.r*) } > CODE |
---|
42 | .rela.got : { *(.rela.got) } > CODE |
---|
43 | .rela.got1 : { *(.rela.got1) } > CODE |
---|
44 | .rela.got2 : { *(.rela.got2) } > CODE |
---|
45 | .rela.ctors : { *(.rela.ctors) } > CODE |
---|
46 | .rela.dtors : { *(.rela.dtors) } > CODE |
---|
47 | .rela.init : { *(.rela.init) } > CODE |
---|
48 | .rela.fini : { *(.rela.fini) } > CODE |
---|
49 | .rela.bss : { *(.rela.bss) } > CODE |
---|
50 | .rela.plt : { *(.rela.plt) } > CODE |
---|
51 | .rela.sdata : { *(.rela.sdata) } > CODE |
---|
52 | .rela.sbss : { *(.rela.sbss) } > CODE |
---|
53 | .rela.sdata2 : { *(.rela.sdata2) } > CODE |
---|
54 | .rela.sbss2 : { *(.rela.sbss2) } > CODE |
---|
55 | .rela.dyn : { *(.rela.dyn) } > CODE |
---|
56 | |
---|
57 | .init : { KEEP(*(.init)) } > CODE |
---|
58 | |
---|
59 | .text : |
---|
60 | { |
---|
61 | *(.text*) |
---|
62 | |
---|
63 | /* |
---|
64 | * Special FreeBSD sysctl sections. |
---|
65 | */ |
---|
66 | . = ALIGN (16); |
---|
67 | __start_set_sysctl_set = .; |
---|
68 | *(set_sysctl_*); |
---|
69 | __stop_set_sysctl_set = ABSOLUTE(.); |
---|
70 | *(set_domain_*); |
---|
71 | *(set_pseudo_*); |
---|
72 | |
---|
73 | /* .gnu.warning sections are handled specially by elf32.em. */ |
---|
74 | *(.gnu.warning) |
---|
75 | *(.gnu.linkonce.t*) |
---|
76 | } > CODE |
---|
77 | |
---|
78 | .fini : { _fini = .; KEEP(*(.fini)) } > CODE |
---|
79 | |
---|
80 | .rodata : { *(.rodata*) *(.gnu.linkonce.r*) } > CODE |
---|
81 | .rodata1 : { *(.rodata1) } > CODE |
---|
82 | |
---|
83 | /* Adjust the address for the data segment. We want to adjust up to |
---|
84 | the same address within the page on the next page up. */ |
---|
85 | . = ALIGN(0x10000) + (. & (0x10000 - 1)); |
---|
86 | /* Ensure the __preinit_array_start label is properly aligned. We |
---|
87 | could instead move the label definition inside the section, but |
---|
88 | the linker would then create the section even if it turns out to |
---|
89 | be empty, which isn't pretty. */ |
---|
90 | . = ALIGN(32 / 8); |
---|
91 | PROVIDE (__preinit_array_start = .); |
---|
92 | .preinit_array : { *(.preinit_array) } >CODE |
---|
93 | PROVIDE (__preinit_array_end = .); |
---|
94 | PROVIDE (__init_array_start = .); |
---|
95 | .init_array : { *(.init_array) } >CODE |
---|
96 | PROVIDE (__init_array_end = .); |
---|
97 | PROVIDE (__fini_array_start = .); |
---|
98 | .fini_array : { *(.fini_array) } >CODE |
---|
99 | PROVIDE (__fini_array_end = .); |
---|
100 | |
---|
101 | _SDA2_BASE_ = __SDATA2_START__ + 0x8000; |
---|
102 | .sdata2 : { *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) } >CODE |
---|
103 | .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) |
---|
104 | /* avoid empty sdata2/sbss2 area -- __eabi would not set up r2 |
---|
105 | * which may be important if run-time loading is used |
---|
106 | */ |
---|
107 | . += 1; |
---|
108 | } >CODE |
---|
109 | .eh_frame : { *(.eh_frame) } >CODE |
---|
110 | |
---|
111 | /* NOTE: if the BSP uses page tables, the correctness of |
---|
112 | * '_etext' (and __DATA_START__) is CRUCIAL - otherwise, |
---|
113 | * an invalid mapping may result!!! |
---|
114 | */ |
---|
115 | _etext = .; |
---|
116 | PROVIDE (etext = .); |
---|
117 | |
---|
118 | /* Adjust the address for the data segment. We want to adjust up to |
---|
119 | the same address within the page on the next page up. It would |
---|
120 | be more correct to do this: |
---|
121 | . = ALIGN(0x40000) + (ALIGN(8) & (0x40000 - 1)); |
---|
122 | The current expression does not correctly handle the case of a |
---|
123 | text segment ending precisely at the end of a page; it causes the |
---|
124 | data segment to skip a page. The above expression does not have |
---|
125 | this problem, but it will currently (2/95) cause BFD to allocate |
---|
126 | a single segment, combining both text and data, for this case. |
---|
127 | This will prevent the text segment from being shared among |
---|
128 | multiple executions of the program; I think that is more |
---|
129 | important than losing a page of the virtual address space (note |
---|
130 | that no actual memory is lost; the page which is skipped can not |
---|
131 | be referenced). */ |
---|
132 | . = ALIGN(0x1000); |
---|
133 | .data ALIGN(0x1000) : |
---|
134 | { |
---|
135 | /* NOTE: if the BSP uses page tables, the correctness of |
---|
136 | * '__DATA_START__' (and _etext) is CRUCIAL - otherwise, |
---|
137 | * an invalid mapping may result!!! |
---|
138 | */ |
---|
139 | PROVIDE(__DATA_START__ = ABSOLUTE(.) ); |
---|
140 | *(.data .data.* .gnu.linkonce.d*) |
---|
141 | SORT(CONSTRUCTORS) |
---|
142 | } > CODE |
---|
143 | .data1 : { *(.data1) } > CODE |
---|
144 | PROVIDE (__EXCEPT_START__ = .); |
---|
145 | .gcc_except_table : { *(.gcc_except_table*) } > CODE |
---|
146 | PROVIDE (__EXCEPT_END__ = .); |
---|
147 | .got1 : { *(.got1) } > CODE |
---|
148 | /* Put .ctors and .dtors next to the .got2 section, so that the pointers |
---|
149 | get relocated with -mrelocatable. Also put in the .fixup pointers. |
---|
150 | The current compiler no longer needs this, but keep it around for 2.7.2 */ |
---|
151 | PROVIDE (_GOT2_START_ = .); |
---|
152 | .got2 : { *(.got2) } > CODE |
---|
153 | .dynamic : { *(.dynamic) } > CODE |
---|
154 | |
---|
155 | .ctors : |
---|
156 | { |
---|
157 | /* gcc uses crtbegin.o to find the start of |
---|
158 | the constructors, so we make sure it is |
---|
159 | first. Because this is a wildcard, it |
---|
160 | doesn't matter if the user does not |
---|
161 | actually link against crtbegin.o; the |
---|
162 | linker won't look for a file to match a |
---|
163 | wildcard. The wildcard also means that it |
---|
164 | doesn't matter which directory crtbegin.o |
---|
165 | is in. */ |
---|
166 | KEEP (*crtbegin.o(.ctors)) |
---|
167 | /* We don't want to include the .ctor section from |
---|
168 | from the crtend.o file until after the sorted ctors. |
---|
169 | The .ctor section from the crtend file contains the |
---|
170 | end of ctors marker and it must be last */ |
---|
171 | KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors)) |
---|
172 | KEEP (*(SORT(.ctors.*))) |
---|
173 | KEEP (*(.ctors)) |
---|
174 | } > CODE |
---|
175 | .dtors : |
---|
176 | { |
---|
177 | KEEP (*crtbegin.o(.dtors)) |
---|
178 | KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors)) |
---|
179 | KEEP (*(SORT(.dtors.*))) |
---|
180 | KEEP (*(.dtors)) |
---|
181 | } > CODE |
---|
182 | |
---|
183 | |
---|
184 | PROVIDE (_FIXUP_START_ = .); |
---|
185 | .fixup : { *(.fixup) } > CODE |
---|
186 | PROVIDE (_FIXUP_END_ = .); |
---|
187 | PROVIDE (_GOT2_END_ = .); |
---|
188 | PROVIDE (_GOT_START_ = .); |
---|
189 | |
---|
190 | .got : { *(.got) } > CODE |
---|
191 | .got.plt : { *(.got.plt) } > CODE |
---|
192 | |
---|
193 | PROVIDE (_GOT_END_ = .); |
---|
194 | |
---|
195 | .jcr : { KEEP (*(.jcr)) } > CODE |
---|
196 | |
---|
197 | /* We want the small data sections together, so single-instruction offsets |
---|
198 | can access them all, and initialized data all before uninitialized, so |
---|
199 | we can shorten the on-disk segment size. */ |
---|
200 | _SDA_BASE_ = __SDATA_START__ + 0x8000; |
---|
201 | .sdata : { *(.sdata*) *(.gnu.linkonce.s.*) } >CODE |
---|
202 | _edata = .; |
---|
203 | PROVIDE (edata = .); |
---|
204 | .sbss : |
---|
205 | { |
---|
206 | PROVIDE (__sbss_start = .); |
---|
207 | *(.dynsbss) |
---|
208 | *(.sbss* .gnu.linkonce.sb.*) |
---|
209 | *(.scommon) |
---|
210 | /* avoid empty sdata/sbss area -- __eabi would not set up r13 |
---|
211 | * which may be important if run-time loading is used |
---|
212 | */ |
---|
213 | . += 1; |
---|
214 | PROVIDE (__sbss_end = .); |
---|
215 | } > CODE |
---|
216 | .plt : { *(.plt) } > CODE |
---|
217 | .bss : |
---|
218 | { |
---|
219 | PROVIDE (__bss_start = .); |
---|
220 | *(.dynbss) |
---|
221 | *(.bss .bss* .gnu.linkonce.b*) |
---|
222 | *(COMMON) |
---|
223 | . = ALIGN(16); |
---|
224 | PROVIDE (__bss_end = .); |
---|
225 | } > CODE |
---|
226 | . = ALIGN(16); |
---|
227 | . += 0x1000; |
---|
228 | __stack = .; |
---|
229 | _end = . ; |
---|
230 | __rtems_end = . ; |
---|
231 | PROVIDE (end = .); |
---|
232 | /DISCARD/ : |
---|
233 | { |
---|
234 | *(.comment) |
---|
235 | } |
---|
236 | |
---|
237 | |
---|
238 | /* Stabs debugging sections. */ |
---|
239 | .stab 0 : { *(.stab) } |
---|
240 | .stabstr 0 : { *(.stabstr) } |
---|
241 | .stab.excl 0 : { *(.stab.excl) } |
---|
242 | .stab.exclstr 0 : { *(.stab.exclstr) } |
---|
243 | .stab.index 0 : { *(.stab.index) } |
---|
244 | .stab.indexstr 0 : { *(.stab.indexstr) } |
---|
245 | .comment 0 : { *(.comment) } |
---|
246 | |
---|
247 | /* DWARF debug sections. |
---|
248 | Symbols in the DWARF debugging sections are relative to the beginning |
---|
249 | of the section so we begin them at 0. */ |
---|
250 | /* DWARF 1 */ |
---|
251 | .debug 0 : { *(.debug) } |
---|
252 | .line 0 : { *(.line) } |
---|
253 | |
---|
254 | /* GNU DWARF 1 extensions */ |
---|
255 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
---|
256 | .debug_sfnames 0 : { *(.debug_sfnames) } |
---|
257 | |
---|
258 | /* DWARF 1.1 and DWARF 2 */ |
---|
259 | .debug_aranges 0 : { *(.debug_aranges) } |
---|
260 | .debug_pubnames 0 : { *(.debug_pubnames) } |
---|
261 | |
---|
262 | /* DWARF 2 */ |
---|
263 | .debug_info 0 : { *(.debug_info) } |
---|
264 | .debug_abbrev 0 : { *(.debug_abbrev) } |
---|
265 | .debug_line 0 : { *(.debug_line) } |
---|
266 | .debug_frame 0 : { *(.debug_frame) } |
---|
267 | .debug_str 0 : { *(.debug_str) } |
---|
268 | .debug_loc 0 : { *(.debug_loc) } |
---|
269 | .debug_macinfo 0 : { *(.debug_macinfo) } |
---|
270 | |
---|
271 | /* SGI/MIPS DWARF 2 extensions */ |
---|
272 | .debug_weaknames 0 : { *(.debug_weaknames) } |
---|
273 | .debug_funcnames 0 : { *(.debug_funcnames) } |
---|
274 | .debug_typenames 0 : { *(.debug_typenames) } |
---|
275 | .debug_varnames 0 : { *(.debug_varnames) } |
---|
276 | /* These must appear regardless of . */ |
---|
277 | } |
---|