blob: d0239bf8d4cc08152f0dd3a85a771add88fb49b1 [file] [log] [blame]
Stephen Rothwellcabb5582005-09-30 16:16:52 +10001#include <linux/config.h>
2#ifdef CONFIG_PPC64
3#include <asm/page.h>
4#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +10005#include <asm-generic/vmlinux.lds.h>
6
Stephen Rothwellcabb5582005-09-30 16:16:52 +10007#ifdef CONFIG_PPC64
8OUTPUT_ARCH(powerpc:common64)
9jiffies = jiffies_64;
10#else
Paul Mackerras14cf11a2005-09-26 16:04:21 +100011OUTPUT_ARCH(powerpc:common)
12jiffies = jiffies_64 + 4;
Stephen Rothwellcabb5582005-09-30 16:16:52 +100013#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +100014SECTIONS
15{
Stephen Rothwellcabb5582005-09-30 16:16:52 +100016 /* Sections to be discarded. */
17 /DISCARD/ : {
18 *(.exitcall.exit)
19#ifdef CONFIG_PPC32
20 *(.exit.data)
21#endif
22 }
23
24
Paul Mackerras14cf11a2005-09-26 16:04:21 +100025 /* Read-only sections, merged into text segment: */
Stephen Rothwellcabb5582005-09-30 16:16:52 +100026#ifdef CONFIG_PPC32
Paul Mackerras14cf11a2005-09-26 16:04:21 +100027 . = + 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 Rothwellcabb5582005-09-30 16:16:52 +100050#endif
51 .text : {
52#ifdef CONFIG_PPC64
53 *(.text .text.*)
54#else
Paul Mackerras14cf11a2005-09-26 16:04:21 +100055 *(.text)
Stephen Rothwellcabb5582005-09-30 16:16:52 +100056#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +100057 SCHED_TEXT
58 LOCK_TEXT
Stephen Rothwellcabb5582005-09-30 16:16:52 +100059#ifdef CONFIG_PPC64
60 KPROBES_TEXT
61#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +100062 *(.fixup)
Stephen Rothwellcabb5582005-09-30 16:16:52 +100063#ifdef CONFIG_PPC32
Paul Mackerras14cf11a2005-09-26 16:04:21 +100064 *(.got1)
65 __got2_start = .;
66 *(.got2)
67 __got2_end = .;
Stephen Rothwellcabb5582005-09-30 16:16:52 +100068#else
69 . = ALIGN(PAGE_SIZE);
70 _etext = .;
71#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +100072 }
Stephen Rothwellcabb5582005-09-30 16:16:52 +100073#ifdef CONFIG_PPC32
Paul Mackerras14cf11a2005-09-26 16:04:21 +100074 _etext = .;
75 PROVIDE (etext = .);
76
77 RODATA
78 .fini : { *(.fini) } =0
79 .ctors : { *(.ctors) }
80 .dtors : { *(.dtors) }
81
82 .fixup : { *(.fixup) }
Stephen Rothwellcabb5582005-09-30 16:16:52 +100083#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +100084
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 Rothwellcabb5582005-09-30 16:16:52 +100097#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 Mackerras14cf11a2005-09-26 16:04:21 +1000108 /* Read-write section, merged into data segment: */
109 . = ALIGN(4096);
Paul Mackerrasc16ff7e2005-10-06 13:28:31 +1000110 _sdata = .;
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000111 .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 Rothwellcabb5582005-09-30 16:16:52 +1000138#else
139 /* will be freed after init */
140 . = ALIGN(PAGE_SIZE);
141#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000142 __init_begin = .;
143 .init.text : {
144 _sinittext = .;
145 *(.init.text)
146 _einittext = .;
147 }
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000148#ifdef CONFIG_PPC32
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000149 /* .exit.text is discarded at runtime, not link time,
150 to deal with references from __bug_table */
151 .exit.text : { *(.exit.text) }
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000152#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000153 .init.data : {
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000154#ifdef CONFIG_PPC64
155 *(.init.data)
156#else
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000157 *(.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 Rothwellcabb5582005-09-30 16:16:52 +1000164#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000165 }
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000166
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000167 . = ALIGN(16);
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000168#ifdef CONFIG_PPC32
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000169 __setup_start = .;
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000170#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 Mackerras14cf11a2005-09-26 16:04:21 +1000181 __setup_end = .;
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000182
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000183 __initcall_start = .;
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000184#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000185 .initcall.init : {
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000186#ifdef CONFIG_PPC64
187 __initcall_start = .;
188#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000189 *(.initcall1.init)
190 *(.initcall2.init)
191 *(.initcall3.init)
192 *(.initcall4.init)
193 *(.initcall5.init)
194 *(.initcall6.init)
195 *(.initcall7.init)
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000196#ifdef CONFIG_PPC64
197 __initcall_end = .;
198#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000199 }
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000200#ifdef CONFIG_PPC32
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000201 __initcall_end = .;
202
203 __con_initcall_start = .;
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000204#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 Mackerras14cf11a2005-09-26 16:04:21 +1000215 __con_initcall_end = .;
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000216#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000217
218 SECURITY_INIT
219
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000220#ifdef CONFIG_PPC32
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000221 __start___ftr_fixup = .;
222 __ftr_fixup : { *(__ftr_fixup) }
223 __stop___ftr_fixup = .;
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000224#else
225 . = ALIGN(PAGE_SIZE);
226 .init.ramfs : {
227 __initramfs_start = .;
228 *(.init.ramfs)
229 __initramfs_end = .;
230 }
231#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000232
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000233#ifdef CONFIG_PPC32
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000234 . = ALIGN(32);
235 __per_cpu_start = .;
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000236#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 Mackerras14cf11a2005-09-26 16:04:21 +1000247 __per_cpu_end = .;
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000248#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000249
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000250#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 Mackerras14cf11a2005-09-26 16:04:21 +1000294 . = ALIGN(4096);
295 __initramfs_start = .;
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000296 .init.ramfs : {
297 *(.init.ramfs)
298 }
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000299 __initramfs_end = .;
300
301 . = ALIGN(4096);
302 __init_end = .;
303
304 . = ALIGN(4096);
305 _sextratext = .;
306 _eextratext = .;
307
308 __bss_start = .;
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000309#endif
310 .bss : {
311#ifdef CONFIG_PPC64
312 __bss_start = .;
313#else
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000314 *(.sbss) *(.scommon)
315 *(.dynbss)
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000316#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000317 *(.bss)
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000318#ifdef CONFIG_PPC32
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000319 *(COMMON)
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000320#else
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000321 __bss_stop = .;
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000322#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000323 }
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000324#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 Mackerras14cf11a2005-09-26 16:04:21 +1000335}