1 /* Default linker script, for normal executables */
2 OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
4 OUTPUT_ARCH(powerpc:common)
6 SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
11 ro PT_LOAD FILEHDR PHDRS;
18 PROVIDE (__executable_start = 0x010000);
19 . = __executable_start + SIZEOF_HEADERS;
20 /* Read-only sections, merged into text segment: */
21 /* PROVIDE (__executable_start = 0x10000000); . = 0x10000000 + SIZEOF_HEADERS;
35 *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
36 *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
39 *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
40 *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
41 *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
42 *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*)
43 *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
44 *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
45 *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
46 *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
47 *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
48 *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
57 *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
58 *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
59 *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
60 *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
61 *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
62 *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
63 *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
64 *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
65 *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
66 *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
72 _program_img_start = _stext;
73 *(.text .stub .text.* .gnu.linkonce.t.*)
74 KEEP(*(.text.*personality*))
75 /* .gnu.warning sections are handled specially by elf32.em. */
87 PROVIDE (__etext = .);
91 KEEP (*(.rol4re_elf_aux))
93 .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } : ro
94 .rodata1 : { *(.rodata1) }
97 PROVIDE (_SDA2_BASE_ = 32768);
98 *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
100 .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
101 .eh_frame_hdr : { *(.eh_frame_hdr) } :ro
102 .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
103 .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
104 . = ALIGN(CONSTANT(MAXPAGESIZE));
105 /* Adjust the address for the data segment. We want to adjust up to
106 the same address within the page on the next page up. */
107 . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
110 /* Exception handling */
111 .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } :rw
112 .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } :rw
113 /* Thread Local Storage sections */
114 .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } :rw
115 .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
118 PROVIDE_HIDDEN (__preinit_array_start = .);
119 KEEP (*(.preinit_array))
120 PROVIDE_HIDDEN (__preinit_array_end = .);
124 PROVIDE_HIDDEN (__init_array_start = .);
125 KEEP (*(SORT(.init_array.*)))
126 KEEP (*(.init_array))
127 PROVIDE_HIDDEN (__init_array_end = .);
131 PROVIDE_HIDDEN (__fini_array_start = .);
132 KEEP (*(.fini_array))
133 KEEP (*(SORT(.fini_array.*)))
134 PROVIDE_HIDDEN (__fini_array_end = .);
136 /* . = ALIGN(0x1000); */
139 /* gcc uses crtbegin.o to find the start of
140 the constructors, so we make sure it is
141 first. Because this is a wildcard, it
142 doesn't matter if the user does not
143 actually link against crtbegin.o; the
144 linker won't look for a file to match a
145 wildcard. The wildcard also means that it
146 doesn't matter which directory crtbegin.o
148 KEEP (*crtbegin.o(.ctors))
149 KEEP (*crtbegin?.o(.ctors))
150 /* We don't want to include the .ctor section from
151 the crtend.o file until after the sorted ctors.
152 The .ctor section from the crtend file contains the
153 end of ctors marker and it must be last */
154 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
155 KEEP (*(SORT(.ctors.*)))
160 KEEP (*crtbegin.o(.dtors))
161 KEEP (*crtbegin?.o(.dtors))
162 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
163 KEEP (*(SORT(.dtors.*)))
166 .jcr : { KEEP (*(.jcr)) }
167 .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
170 .dynamic : { *(.dynamic) }
171 .got : SPECIAL { *(.got) }
172 . = DATA_SEGMENT_RELRO_END (0, .);
173 .plt : SPECIAL { *(.plt) }
176 *(.data .data.* .gnu.linkonce.d.*)
177 KEEP (*(.gnu.linkonce.d.*personality*))
180 .data1 : { *(.data1) }
181 .got : SPECIAL { *(.got) }
182 /* We want the small data sections together, so single-instruction offsets
183 can access them all, and initialized data all before uninitialized, so
184 we can shorten the on-disk segment size. */
187 PROVIDE (_SDA_BASE_ = 32768);
188 *(.sdata .sdata.* .gnu.linkonce.s.*)
190 _edata = .; PROVIDE (edata = .);
194 PROVIDE (__sbss_start = .); PROVIDE (___sbss_start = .);
196 *(.sbss .sbss.* .gnu.linkonce.sb.*)
198 PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .);
200 .plt : SPECIAL { *(.plt) }
204 *(.bss .bss.* .gnu.linkonce.b.*)
206 /* Align here to ensure that the .bss section occupies space up to
207 _end. Align after .bss to ensure correct alignment even if the
208 .bss section disappears because there are no input sections.
209 FIXME: Why do we need it? When there is no .bss section, we don't
210 pad the .data section. */
211 . = ALIGN(. != 0 ? 32 / 8 : 1);
215 _end = .; PROVIDE (end = .);
216 . = DATA_SEGMENT_END (.);
217 /* Stabs debugging sections. */
218 .stab 0 : { *(.stab) }
219 .stabstr 0 : { *(.stabstr) }
220 .stab.excl 0 : { *(.stab.excl) }
221 .stab.exclstr 0 : { *(.stab.exclstr) }
222 .stab.index 0 : { *(.stab.index) }
223 .stab.indexstr 0 : { *(.stab.indexstr) }
224 .comment 0 : { *(.comment) }
225 /* DWARF debug sections.
226 Symbols in the DWARF debugging sections are relative to the beginning
227 of the section so we begin them at 0. */
229 .debug 0 : { *(.debug) }
230 .line 0 : { *(.line) }
231 /* GNU DWARF 1 extensions */
232 .debug_srcinfo 0 : { *(.debug_srcinfo) }
233 .debug_sfnames 0 : { *(.debug_sfnames) }
234 /* DWARF 1.1 and DWARF 2 */
235 .debug_aranges 0 : { *(.debug_aranges) }
236 .debug_pubnames 0 : { *(.debug_pubnames) }
238 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
239 .debug_abbrev 0 : { *(.debug_abbrev) }
240 .debug_line 0 : { *(.debug_line) }
241 .debug_frame 0 : { *(.debug_frame) }
242 .debug_str 0 : { *(.debug_str) }
243 .debug_loc 0 : { *(.debug_loc) }
244 .debug_macinfo 0 : { *(.debug_macinfo) }
245 /* SGI/MIPS DWARF 2 extensions */
246 .debug_weaknames 0 : { *(.debug_weaknames) }
247 .debug_funcnames 0 : { *(.debug_funcnames) }
248 .debug_typenames 0 : { *(.debug_typenames) }
249 .debug_varnames 0 : { *(.debug_varnames) }
251 .debug_pubtypes 0 : { *(.debug_pubtypes) }
252 .debug_ranges 0 : { *(.debug_ranges) }
253 .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
254 /DISCARD/ : { *(.fixup) }
255 /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }