root / ppc.ld @ e3e87df4
History | View | Annotate | Download (8.5 kB)
1 | 766a487a | bellard | /* ld script to make i386 Linux kernel |
---|---|---|---|
2 | 766a487a | bellard | * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>; |
3 | 766a487a | bellard | */ |
4 | 766a487a | bellard | OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc") |
5 | 85a6f129 | ths | OUTPUT_ARCH(powerpc:common) |
6 | 766a487a | bellard | ENTRY(_start) |
7 | 766a487a | bellard | SECTIONS |
8 | 766a487a | bellard | { |
9 | 766a487a | bellard | /* Read-only sections, merged into text segment: */ |
10 | 766a487a | bellard | . = 0x60000000 + SIZEOF_HEADERS; |
11 | 766a487a | bellard | .interp : { *(.interp) } |
12 | 766a487a | bellard | .hash : { *(.hash) } |
13 | 766a487a | bellard | .dynsym : { *(.dynsym) } |
14 | 766a487a | bellard | .dynstr : { *(.dynstr) } |
15 | 766a487a | bellard | .gnu.version : { *(.gnu.version) } |
16 | 766a487a | bellard | .gnu.version_d : { *(.gnu.version_d) } |
17 | 766a487a | bellard | .gnu.version_r : { *(.gnu.version_r) } |
18 | 85a6f129 | ths | .rel.init : { *(.rel.init) } |
19 | 85a6f129 | ths | .rela.init : { *(.rela.init) } |
20 | 85a6f129 | ths | .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } |
21 | 85a6f129 | ths | .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } |
22 | 85a6f129 | ths | .rel.fini : { *(.rel.fini) } |
23 | 85a6f129 | ths | .rela.fini : { *(.rela.fini) } |
24 | 85a6f129 | ths | .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } |
25 | 85a6f129 | ths | .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } |
26 | 85a6f129 | ths | .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) } |
27 | 85a6f129 | ths | .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) } |
28 | 85a6f129 | ths | .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } |
29 | 85a6f129 | ths | .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } |
30 | 85a6f129 | ths | .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } |
31 | 85a6f129 | ths | .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } |
32 | 85a6f129 | ths | .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } |
33 | 85a6f129 | ths | .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } |
34 | 85a6f129 | ths | .rel.ctors : { *(.rel.ctors) } |
35 | 85a6f129 | ths | .rela.ctors : { *(.rela.ctors) } |
36 | 85a6f129 | ths | .rel.dtors : { *(.rel.dtors) } |
37 | 85a6f129 | ths | .rela.dtors : { *(.rela.dtors) } |
38 | 85a6f129 | ths | .rel.got : { *(.rel.got) } |
39 | 85a6f129 | ths | .rela.got : { *(.rela.got) } |
40 | 85a6f129 | ths | .rela.got1 : { *(.rela.got1) } |
41 | 85a6f129 | ths | .rela.got2 : { *(.rela.got2) } |
42 | 85a6f129 | ths | .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) } |
43 | 85a6f129 | ths | .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) } |
44 | 85a6f129 | ths | .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) } |
45 | 85a6f129 | ths | .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) } |
46 | 85a6f129 | ths | .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) } |
47 | 85a6f129 | ths | .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) } |
48 | 85a6f129 | ths | .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) } |
49 | 85a6f129 | ths | .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) } |
50 | 85a6f129 | ths | .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } |
51 | 85a6f129 | ths | .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } |
52 | 665a04ae | Alexander Graf | .rel.plt : |
53 | 665a04ae | Alexander Graf | { |
54 | 665a04ae | Alexander Graf | *(.rel.plt) |
55 | 665a04ae | Alexander Graf | PROVIDE (__rel_iplt_start = .); |
56 | 665a04ae | Alexander Graf | *(.rel.iplt) |
57 | 665a04ae | Alexander Graf | PROVIDE (__rel_iplt_end = .); |
58 | 665a04ae | Alexander Graf | } |
59 | 665a04ae | Alexander Graf | .rela.plt : |
60 | 665a04ae | Alexander Graf | { |
61 | 665a04ae | Alexander Graf | *(.rela.plt) |
62 | 665a04ae | Alexander Graf | PROVIDE (__rela_iplt_start = .); |
63 | 665a04ae | Alexander Graf | *(.rela.iplt) |
64 | 665a04ae | Alexander Graf | PROVIDE (__rela_iplt_end = .); |
65 | 665a04ae | Alexander Graf | } |
66 | 85a6f129 | ths | .init : |
67 | 766a487a | bellard | { |
68 | 85a6f129 | ths | KEEP (*(.init)) |
69 | 85a6f129 | ths | } =0 |
70 | 85a6f129 | ths | .text : |
71 | 85a6f129 | ths | { |
72 | 85a6f129 | ths | *(.text .stub .text.* .gnu.linkonce.t.*) |
73 | 85a6f129 | ths | KEEP (*(.text.*personality*)) |
74 | 766a487a | bellard | /* .gnu.warning sections are handled specially by elf32.em. */ |
75 | 766a487a | bellard | *(.gnu.warning) |
76 | 85a6f129 | ths | *(.glink) |
77 | 85a6f129 | ths | } =0x47ff041f |
78 | 85a6f129 | ths | .fini : |
79 | 85a6f129 | ths | { |
80 | 85a6f129 | ths | KEEP (*(.fini)) |
81 | 766a487a | bellard | } =0x47ff041f |
82 | 85a6f129 | ths | PROVIDE (__etext = .); |
83 | 85a6f129 | ths | PROVIDE (_etext = .); |
84 | 766a487a | bellard | PROVIDE (etext = .); |
85 | 85a6f129 | ths | .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } |
86 | 85a6f129 | ths | .rodata1 : { *(.rodata1) } |
87 | 85a6f129 | ths | .sdata2 : |
88 | 85a6f129 | ths | { |
89 | 85a6f129 | ths | PROVIDE (_SDA2_BASE_ = 32768); |
90 | 85a6f129 | ths | *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) |
91 | 85a6f129 | ths | } |
92 | 85a6f129 | ths | .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) } |
93 | 85a6f129 | ths | .eh_frame_hdr : { *(.eh_frame_hdr) } |
94 | 766a487a | bellard | /* Adjust the address for the data segment. We want to adjust up to |
95 | 766a487a | bellard | the same address within the page on the next page up. */ |
96 | 85a6f129 | ths | . = ALIGN (0x10000) - ((0x10000 - .) & (0x10000 - 1)); . = DATA_SEGMENT_ALIGN (0x10000, 0x1000); |
97 | 85a6f129 | ths | /* Exception handling */ |
98 | 8733f609 | Gerd Hoffmann | .eh_frame : { KEEP (*(.eh_frame)) } |
99 | 8733f609 | Gerd Hoffmann | .gcc_except_table : { *(.gcc_except_table .gcc_except_table.*) } |
100 | 85a6f129 | ths | /* Thread Local Storage sections */ |
101 | 85a6f129 | ths | .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } |
102 | 85a6f129 | ths | .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } |
103 | 85a6f129 | ths | .preinit_array : |
104 | 85a6f129 | ths | { |
105 | 8733f609 | Gerd Hoffmann | PROVIDE (__preinit_array_start = .); |
106 | 85a6f129 | ths | KEEP (*(.preinit_array)) |
107 | 8733f609 | Gerd Hoffmann | PROVIDE (__preinit_array_end = .); |
108 | 85a6f129 | ths | } |
109 | 85a6f129 | ths | .init_array : |
110 | 85a6f129 | ths | { |
111 | 8733f609 | Gerd Hoffmann | PROVIDE (__init_array_start = .); |
112 | 85a6f129 | ths | KEEP (*(SORT(.init_array.*))) |
113 | 85a6f129 | ths | KEEP (*(.init_array)) |
114 | 8733f609 | Gerd Hoffmann | PROVIDE (__init_array_end = .); |
115 | 85a6f129 | ths | } |
116 | 85a6f129 | ths | .fini_array : |
117 | 85a6f129 | ths | { |
118 | 8733f609 | Gerd Hoffmann | PROVIDE (__fini_array_start = .); |
119 | 85a6f129 | ths | KEEP (*(.fini_array)) |
120 | 85a6f129 | ths | KEEP (*(SORT(.fini_array.*))) |
121 | 8733f609 | Gerd Hoffmann | PROVIDE (__fini_array_end = .); |
122 | 85a6f129 | ths | } |
123 | 85a6f129 | ths | .ctors : |
124 | 766a487a | bellard | { |
125 | 85a6f129 | ths | /* gcc uses crtbegin.o to find the start of |
126 | 85a6f129 | ths | the constructors, so we make sure it is |
127 | 85a6f129 | ths | first. Because this is a wildcard, it |
128 | 85a6f129 | ths | doesn't matter if the user does not |
129 | 85a6f129 | ths | actually link against crtbegin.o; the |
130 | 85a6f129 | ths | linker won't look for a file to match a |
131 | 85a6f129 | ths | wildcard. The wildcard also means that it |
132 | 85a6f129 | ths | doesn't matter which directory crtbegin.o |
133 | 85a6f129 | ths | is in. */ |
134 | 85a6f129 | ths | KEEP (*crtbegin*.o(.ctors)) |
135 | 85a6f129 | ths | /* We don't want to include the .ctor section from |
136 | 85a6f129 | ths | the crtend.o file until after the sorted ctors. |
137 | 85a6f129 | ths | The .ctor section from the crtend file contains the |
138 | 85a6f129 | ths | end of ctors marker and it must be last */ |
139 | 85a6f129 | ths | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors)) |
140 | 85a6f129 | ths | KEEP (*(SORT(.ctors.*))) |
141 | 85a6f129 | ths | KEEP (*(.ctors)) |
142 | 766a487a | bellard | } |
143 | 85a6f129 | ths | .dtors : |
144 | 766a487a | bellard | { |
145 | 85a6f129 | ths | KEEP (*crtbegin*.o(.dtors)) |
146 | 85a6f129 | ths | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors)) |
147 | 85a6f129 | ths | KEEP (*(SORT(.dtors.*))) |
148 | 85a6f129 | ths | KEEP (*(.dtors)) |
149 | 766a487a | bellard | } |
150 | 85a6f129 | ths | .jcr : { KEEP (*(.jcr)) } |
151 | 85a6f129 | ths | .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) } |
152 | 85a6f129 | ths | .got1 : { *(.got1) } |
153 | 85a6f129 | ths | .got2 : { *(.got2) } |
154 | 85a6f129 | ths | .dynamic : { *(.dynamic) } |
155 | 85a6f129 | ths | .got : SPECIAL { *(.got) } |
156 | 85a6f129 | ths | . = DATA_SEGMENT_RELRO_END (0, .); |
157 | 85a6f129 | ths | .plt : SPECIAL { *(.plt) } |
158 | 85a6f129 | ths | .data : |
159 | 766a487a | bellard | { |
160 | 85a6f129 | ths | *(.data .data.* .gnu.linkonce.d.*) |
161 | 85a6f129 | ths | KEEP (*(.gnu.linkonce.d.*personality*)) |
162 | 85a6f129 | ths | SORT(CONSTRUCTORS) |
163 | 766a487a | bellard | } |
164 | 85a6f129 | ths | .data1 : { *(.data1) } |
165 | 85a6f129 | ths | .got : SPECIAL { *(.got) } |
166 | 766a487a | bellard | /* We want the small data sections together, so single-instruction offsets |
167 | 766a487a | bellard | can access them all, and initialized data all before uninitialized, so |
168 | 766a487a | bellard | we can shorten the on-disk segment size. */ |
169 | 85a6f129 | ths | .sdata : |
170 | 85a6f129 | ths | { |
171 | 85a6f129 | ths | PROVIDE (_SDA_BASE_ = 32768); |
172 | 85a6f129 | ths | *(.sdata .sdata.* .gnu.linkonce.s.*) |
173 | 85a6f129 | ths | } |
174 | 85a6f129 | ths | _edata = .; PROVIDE (edata = .); |
175 | 766a487a | bellard | __bss_start = .; |
176 | 85a6f129 | ths | .sbss : |
177 | 85a6f129 | ths | { |
178 | 85a6f129 | ths | PROVIDE (__sbss_start = .); PROVIDE (___sbss_start = .); |
179 | 85a6f129 | ths | *(.dynsbss) |
180 | 85a6f129 | ths | *(.sbss .sbss.* .gnu.linkonce.sb.*) |
181 | 85a6f129 | ths | *(.scommon) |
182 | 85a6f129 | ths | PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .); |
183 | 85a6f129 | ths | } |
184 | 85a6f129 | ths | .plt : SPECIAL { *(.plt) } |
185 | 85a6f129 | ths | .bss : |
186 | 766a487a | bellard | { |
187 | 766a487a | bellard | *(.dynbss) |
188 | 85a6f129 | ths | *(.bss .bss.* .gnu.linkonce.b.*) |
189 | 766a487a | bellard | *(COMMON) |
190 | 85a6f129 | ths | /* Align here to ensure that the .bss section occupies space up to |
191 | 85a6f129 | ths | _end. Align after .bss to ensure correct alignment even if the |
192 | 85a6f129 | ths | .bss section disappears because there are no input sections. |
193 | 85a6f129 | ths | FIXME: Why do we need it? When there is no .bss section, we don't |
194 | 85a6f129 | ths | pad the .data section. */ |
195 | 85a6f129 | ths | . = ALIGN(. != 0 ? 32 / 8 : 1); |
196 | 766a487a | bellard | } |
197 | 85a6f129 | ths | . = ALIGN(32 / 8); |
198 | 85a6f129 | ths | . = ALIGN(32 / 8); |
199 | 85a6f129 | ths | _end = .; PROVIDE (end = .); |
200 | 85a6f129 | ths | . = DATA_SEGMENT_END (.); |
201 | 766a487a | bellard | /* Stabs debugging sections. */ |
202 | 766a487a | bellard | .stab 0 : { *(.stab) } |
203 | 766a487a | bellard | .stabstr 0 : { *(.stabstr) } |
204 | 766a487a | bellard | .stab.excl 0 : { *(.stab.excl) } |
205 | 766a487a | bellard | .stab.exclstr 0 : { *(.stab.exclstr) } |
206 | 766a487a | bellard | .stab.index 0 : { *(.stab.index) } |
207 | 766a487a | bellard | .stab.indexstr 0 : { *(.stab.indexstr) } |
208 | 766a487a | bellard | .comment 0 : { *(.comment) } |
209 | 766a487a | bellard | /* DWARF debug sections. |
210 | 766a487a | bellard | Symbols in the DWARF debugging sections are relative to the beginning |
211 | 766a487a | bellard | of the section so we begin them at 0. */ |
212 | 766a487a | bellard | /* DWARF 1 */ |
213 | 766a487a | bellard | .debug 0 : { *(.debug) } |
214 | 766a487a | bellard | .line 0 : { *(.line) } |
215 | 766a487a | bellard | /* GNU DWARF 1 extensions */ |
216 | 766a487a | bellard | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
217 | 766a487a | bellard | .debug_sfnames 0 : { *(.debug_sfnames) } |
218 | 766a487a | bellard | /* DWARF 1.1 and DWARF 2 */ |
219 | 766a487a | bellard | .debug_aranges 0 : { *(.debug_aranges) } |
220 | 766a487a | bellard | .debug_pubnames 0 : { *(.debug_pubnames) } |
221 | 766a487a | bellard | /* DWARF 2 */ |
222 | 766a487a | bellard | .debug_info 0 : { *(.debug_info) } |
223 | 766a487a | bellard | .debug_abbrev 0 : { *(.debug_abbrev) } |
224 | 766a487a | bellard | .debug_line 0 : { *(.debug_line) } |
225 | 766a487a | bellard | .debug_frame 0 : { *(.debug_frame) } |
226 | 766a487a | bellard | .debug_str 0 : { *(.debug_str) } |
227 | 766a487a | bellard | .debug_loc 0 : { *(.debug_loc) } |
228 | 766a487a | bellard | .debug_macinfo 0 : { *(.debug_macinfo) } |
229 | 766a487a | bellard | /* SGI/MIPS DWARF 2 extensions */ |
230 | 766a487a | bellard | .debug_weaknames 0 : { *(.debug_weaknames) } |
231 | 766a487a | bellard | .debug_funcnames 0 : { *(.debug_funcnames) } |
232 | 766a487a | bellard | .debug_typenames 0 : { *(.debug_typenames) } |
233 | 766a487a | bellard | .debug_varnames 0 : { *(.debug_varnames) } |
234 | 766a487a | bellard | /* These must appear regardless of . */ |
235 | 85a6f129 | ths | /DISCARD/ : { *(.fixup) } |
236 | 85a6f129 | ths | /DISCARD/ : { *(.note.GNU-stack) } |
237 | 766a487a | bellard | } |