Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 1 | #include <linux/config.h> |
2 | #ifdef CONFIG_PPC64 | ||||
3 | #include <asm/page.h> | ||||
4 | #endif | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 5 | #include <asm-generic/vmlinux.lds.h> |
6 | |||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 7 | #ifdef CONFIG_PPC64 |
8 | OUTPUT_ARCH(powerpc:common64) | ||||
9 | jiffies = jiffies_64; | ||||
10 | #else | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 11 | OUTPUT_ARCH(powerpc:common) |
12 | jiffies = jiffies_64 + 4; | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 13 | #endif |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 14 | SECTIONS |
15 | { | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 16 | /* Sections to be discarded. */ |
17 | /DISCARD/ : { | ||||
18 | *(.exitcall.exit) | ||||
19 | #ifdef CONFIG_PPC32 | ||||
20 | *(.exit.data) | ||||
21 | #endif | ||||
22 | } | ||||
23 | |||||
24 | |||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 25 | /* Read-only sections, merged into text segment: */ |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 26 | #ifdef CONFIG_PPC32 |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 27 | . = + SIZEOF_HEADERS; |
28 | .interp : { *(.interp) } | ||||
29 | .hash : { *(.hash) } | ||||
30 | .dynsym : { *(.dynsym) } | ||||
31 | .dynstr : { *(.dynstr) } | ||||
32 | .rel.text : { *(.rel.text) } | ||||
33 | .rela.text : { *(.rela.text) } | ||||
34 | .rel.data : { *(.rel.data) } | ||||
35 | .rela.data : { *(.rela.data) } | ||||
36 | .rel.rodata : { *(.rel.rodata) } | ||||
37 | .rela.rodata : { *(.rela.rodata) } | ||||
38 | .rel.got : { *(.rel.got) } | ||||
39 | .rela.got : { *(.rela.got) } | ||||
40 | .rel.ctors : { *(.rel.ctors) } | ||||
41 | .rela.ctors : { *(.rela.ctors) } | ||||
42 | .rel.dtors : { *(.rel.dtors) } | ||||
43 | .rela.dtors : { *(.rela.dtors) } | ||||
44 | .rel.bss : { *(.rel.bss) } | ||||
45 | .rela.bss : { *(.rela.bss) } | ||||
46 | .rel.plt : { *(.rel.plt) } | ||||
47 | .rela.plt : { *(.rela.plt) } | ||||
48 | /* .init : { *(.init) } =0*/ | ||||
49 | .plt : { *(.plt) } | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 50 | #endif |
51 | .text : { | ||||
52 | #ifdef CONFIG_PPC64 | ||||
53 | *(.text .text.*) | ||||
54 | #else | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 55 | *(.text) |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 56 | #endif |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 57 | SCHED_TEXT |
58 | LOCK_TEXT | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 59 | #ifdef CONFIG_PPC64 |
60 | KPROBES_TEXT | ||||
61 | #endif | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 62 | *(.fixup) |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 63 | #ifdef CONFIG_PPC32 |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 64 | *(.got1) |
65 | __got2_start = .; | ||||
66 | *(.got2) | ||||
67 | __got2_end = .; | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 68 | #else |
69 | . = ALIGN(PAGE_SIZE); | ||||
70 | _etext = .; | ||||
71 | #endif | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 72 | } |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 73 | #ifdef CONFIG_PPC32 |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 74 | _etext = .; |
75 | PROVIDE (etext = .); | ||||
76 | |||||
77 | RODATA | ||||
78 | .fini : { *(.fini) } =0 | ||||
79 | .ctors : { *(.ctors) } | ||||
80 | .dtors : { *(.dtors) } | ||||
81 | |||||
82 | .fixup : { *(.fixup) } | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 83 | #endif |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 84 | |
85 | __ex_table : { | ||||
86 | __start___ex_table = .; | ||||
87 | *(__ex_table) | ||||
88 | __stop___ex_table = .; | ||||
89 | } | ||||
90 | |||||
91 | __bug_table : { | ||||
92 | __start___bug_table = .; | ||||
93 | *(__bug_table) | ||||
94 | __stop___bug_table = .; | ||||
95 | } | ||||
96 | |||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 97 | #ifdef CONFIG_PPC64 |
98 | __ftr_fixup : { | ||||
99 | __start___ftr_fixup = .; | ||||
100 | *(__ftr_fixup) | ||||
101 | __stop___ftr_fixup = .; | ||||
102 | } | ||||
103 | |||||
104 | RODATA | ||||
105 | #endif | ||||
106 | |||||
107 | #ifdef CONFIG_PPC32 | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 108 | /* Read-write section, merged into data segment: */ |
109 | . = ALIGN(4096); | ||||
Paul Mackerras | c16ff7e | 2005-10-06 13:28:31 +1000 | [diff] [blame^] | 110 | _sdata = .; |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 111 | .data : |
112 | { | ||||
113 | *(.data) | ||||
114 | *(.data1) | ||||
115 | *(.sdata) | ||||
116 | *(.sdata2) | ||||
117 | *(.got.plt) *(.got) | ||||
118 | *(.dynamic) | ||||
119 | CONSTRUCTORS | ||||
120 | } | ||||
121 | |||||
122 | . = ALIGN(4096); | ||||
123 | __nosave_begin = .; | ||||
124 | .data_nosave : { *(.data.nosave) } | ||||
125 | . = ALIGN(4096); | ||||
126 | __nosave_end = .; | ||||
127 | |||||
128 | . = ALIGN(32); | ||||
129 | .data.cacheline_aligned : { *(.data.cacheline_aligned) } | ||||
130 | |||||
131 | _edata = .; | ||||
132 | PROVIDE (edata = .); | ||||
133 | |||||
134 | . = ALIGN(8192); | ||||
135 | .data.init_task : { *(.data.init_task) } | ||||
136 | |||||
137 | . = ALIGN(4096); | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 138 | #else |
139 | /* will be freed after init */ | ||||
140 | . = ALIGN(PAGE_SIZE); | ||||
141 | #endif | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 142 | __init_begin = .; |
143 | .init.text : { | ||||
144 | _sinittext = .; | ||||
145 | *(.init.text) | ||||
146 | _einittext = .; | ||||
147 | } | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 148 | #ifdef CONFIG_PPC32 |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 149 | /* .exit.text is discarded at runtime, not link time, |
150 | to deal with references from __bug_table */ | ||||
151 | .exit.text : { *(.exit.text) } | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 152 | #endif |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 153 | .init.data : { |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 154 | #ifdef CONFIG_PPC64 |
155 | *(.init.data) | ||||
156 | #else | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 157 | *(.init.data); |
158 | __vtop_table_begin = .; | ||||
159 | *(.vtop_fixup); | ||||
160 | __vtop_table_end = .; | ||||
161 | __ptov_table_begin = .; | ||||
162 | *(.ptov_fixup); | ||||
163 | __ptov_table_end = .; | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 164 | #endif |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 165 | } |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 166 | |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 167 | . = ALIGN(16); |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 168 | #ifdef CONFIG_PPC32 |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 169 | __setup_start = .; |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 170 | #endif |
171 | .init.setup : { | ||||
172 | #ifdef CONFIG_PPC64 | ||||
173 | __setup_start = .; | ||||
174 | #endif | ||||
175 | *(.init.setup) | ||||
176 | #ifdef CONFIG_PPC64 | ||||
177 | __setup_end = .; | ||||
178 | #endif | ||||
179 | } | ||||
180 | #ifdef CONFIG_PPC32 | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 181 | __setup_end = .; |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 182 | |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 183 | __initcall_start = .; |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 184 | #endif |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 185 | .initcall.init : { |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 186 | #ifdef CONFIG_PPC64 |
187 | __initcall_start = .; | ||||
188 | #endif | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 189 | *(.initcall1.init) |
190 | *(.initcall2.init) | ||||
191 | *(.initcall3.init) | ||||
192 | *(.initcall4.init) | ||||
193 | *(.initcall5.init) | ||||
194 | *(.initcall6.init) | ||||
195 | *(.initcall7.init) | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 196 | #ifdef CONFIG_PPC64 |
197 | __initcall_end = .; | ||||
198 | #endif | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 199 | } |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 200 | #ifdef CONFIG_PPC32 |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 201 | __initcall_end = .; |
202 | |||||
203 | __con_initcall_start = .; | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 204 | #endif |
205 | .con_initcall.init : { | ||||
206 | #ifdef CONFIG_PPC64 | ||||
207 | __con_initcall_start = .; | ||||
208 | #endif | ||||
209 | *(.con_initcall.init) | ||||
210 | #ifdef CONFIG_PPC64 | ||||
211 | __con_initcall_end = .; | ||||
212 | #endif | ||||
213 | } | ||||
214 | #ifdef CONFIG_PPC32 | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 215 | __con_initcall_end = .; |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 216 | #endif |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 217 | |
218 | SECURITY_INIT | ||||
219 | |||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 220 | #ifdef CONFIG_PPC32 |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 221 | __start___ftr_fixup = .; |
222 | __ftr_fixup : { *(__ftr_fixup) } | ||||
223 | __stop___ftr_fixup = .; | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 224 | #else |
225 | . = ALIGN(PAGE_SIZE); | ||||
226 | .init.ramfs : { | ||||
227 | __initramfs_start = .; | ||||
228 | *(.init.ramfs) | ||||
229 | __initramfs_end = .; | ||||
230 | } | ||||
231 | #endif | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 232 | |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 233 | #ifdef CONFIG_PPC32 |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 234 | . = ALIGN(32); |
235 | __per_cpu_start = .; | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 236 | #endif |
237 | .data.percpu : { | ||||
238 | #ifdef CONFIG_PPC64 | ||||
239 | __per_cpu_start = .; | ||||
240 | #endif | ||||
241 | *(.data.percpu) | ||||
242 | #ifdef CONFIG_PPC64 | ||||
243 | __per_cpu_end = .; | ||||
244 | #endif | ||||
245 | } | ||||
246 | #ifdef CONFIG_PPC32 | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 247 | __per_cpu_end = .; |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 248 | #endif |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 249 | |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 250 | #ifdef CONFIG_PPC64 |
251 | . = ALIGN(PAGE_SIZE); | ||||
252 | . = ALIGN(16384); | ||||
253 | __init_end = .; | ||||
254 | /* freed after init ends here */ | ||||
255 | |||||
256 | |||||
257 | /* Read/write sections */ | ||||
258 | . = ALIGN(PAGE_SIZE); | ||||
259 | . = ALIGN(16384); | ||||
260 | /* The initial task and kernel stack */ | ||||
261 | .data.init_task : { | ||||
262 | *(.data.init_task) | ||||
263 | } | ||||
264 | |||||
265 | . = ALIGN(PAGE_SIZE); | ||||
266 | .data.page_aligned : { | ||||
267 | *(.data.page_aligned) | ||||
268 | } | ||||
269 | |||||
270 | .data.cacheline_aligned : { | ||||
271 | *(.data.cacheline_aligned) | ||||
272 | } | ||||
273 | |||||
274 | .data : { | ||||
275 | *(.data .data.rel* .toc1) | ||||
276 | *(.branch_lt) | ||||
277 | } | ||||
278 | |||||
279 | .opd : { | ||||
280 | *(.opd) | ||||
281 | } | ||||
282 | |||||
283 | .got : { | ||||
284 | __toc_start = .; | ||||
285 | *(.got) | ||||
286 | *(.toc) | ||||
287 | . = ALIGN(PAGE_SIZE); | ||||
288 | _edata = .; | ||||
289 | } | ||||
290 | |||||
291 | |||||
292 | . = ALIGN(PAGE_SIZE); | ||||
293 | #else | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 294 | . = ALIGN(4096); |
295 | __initramfs_start = .; | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 296 | .init.ramfs : { |
297 | *(.init.ramfs) | ||||
298 | } | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 299 | __initramfs_end = .; |
300 | |||||
301 | . = ALIGN(4096); | ||||
302 | __init_end = .; | ||||
303 | |||||
304 | . = ALIGN(4096); | ||||
305 | _sextratext = .; | ||||
306 | _eextratext = .; | ||||
307 | |||||
308 | __bss_start = .; | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 309 | #endif |
310 | .bss : { | ||||
311 | #ifdef CONFIG_PPC64 | ||||
312 | __bss_start = .; | ||||
313 | #else | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 314 | *(.sbss) *(.scommon) |
315 | *(.dynbss) | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 316 | #endif |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 317 | *(.bss) |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 318 | #ifdef CONFIG_PPC32 |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 319 | *(COMMON) |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 320 | #else |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 321 | __bss_stop = .; |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 322 | #endif |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 323 | } |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 324 | #ifdef CONFIG_PPC32 |
325 | __bss_stop = .; | ||||
326 | #endif | ||||
327 | |||||
328 | #ifdef CONFIG_PPC64 | ||||
329 | . = ALIGN(PAGE_SIZE); | ||||
330 | #endif | ||||
331 | _end = . ; | ||||
332 | #ifdef CONFIG_PPC32 | ||||
333 | PROVIDE (end = .); | ||||
334 | #endif | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 335 | } |