]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - arch/powerpc/kernel/vmlinux.lds.S
powerpc: Reduce the 32/64-bit differences in traps.c
[mirror_ubuntu-artful-kernel.git] / arch / powerpc / kernel / vmlinux.lds.S
CommitLineData
cabb5587
SR
1#include <linux/config.h>
2#ifdef CONFIG_PPC64
3#include <asm/page.h>
4#endif
14cf11af
PM
5#include <asm-generic/vmlinux.lds.h>
6
cabb5587
SR
7#ifdef CONFIG_PPC64
8OUTPUT_ARCH(powerpc:common64)
9jiffies = jiffies_64;
10#else
14cf11af
PM
11OUTPUT_ARCH(powerpc:common)
12jiffies = jiffies_64 + 4;
cabb5587 13#endif
14cf11af
PM
14SECTIONS
15{
cabb5587
SR
16 /* Sections to be discarded. */
17 /DISCARD/ : {
18 *(.exitcall.exit)
19#ifdef CONFIG_PPC32
20 *(.exit.data)
21#endif
22 }
23
24
14cf11af 25 /* Read-only sections, merged into text segment: */
cabb5587 26#ifdef CONFIG_PPC32
14cf11af
PM
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) }
cabb5587
SR
50#endif
51 .text : {
52#ifdef CONFIG_PPC64
53 *(.text .text.*)
54#else
14cf11af 55 *(.text)
cabb5587 56#endif
14cf11af
PM
57 SCHED_TEXT
58 LOCK_TEXT
cabb5587
SR
59#ifdef CONFIG_PPC64
60 KPROBES_TEXT
61#endif
14cf11af 62 *(.fixup)
cabb5587 63#ifdef CONFIG_PPC32
14cf11af
PM
64 *(.got1)
65 __got2_start = .;
66 *(.got2)
67 __got2_end = .;
cabb5587
SR
68#else
69 . = ALIGN(PAGE_SIZE);
70 _etext = .;
71#endif
14cf11af 72 }
cabb5587 73#ifdef CONFIG_PPC32
14cf11af
PM
74 _etext = .;
75 PROVIDE (etext = .);
76
77 RODATA
78 .fini : { *(.fini) } =0
79 .ctors : { *(.ctors) }
80 .dtors : { *(.dtors) }
81
82 .fixup : { *(.fixup) }
cabb5587 83#endif
14cf11af
PM
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
cabb5587
SR
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
14cf11af
PM
108 /* Read-write section, merged into data segment: */
109 . = ALIGN(4096);
c16ff7e4 110 _sdata = .;
14cf11af
PM
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);
cabb5587
SR
138#else
139 /* will be freed after init */
140 . = ALIGN(PAGE_SIZE);
141#endif
14cf11af
PM
142 __init_begin = .;
143 .init.text : {
144 _sinittext = .;
145 *(.init.text)
146 _einittext = .;
147 }
cabb5587 148#ifdef CONFIG_PPC32
14cf11af
PM
149 /* .exit.text is discarded at runtime, not link time,
150 to deal with references from __bug_table */
151 .exit.text : { *(.exit.text) }
cabb5587 152#endif
14cf11af 153 .init.data : {
cabb5587
SR
154#ifdef CONFIG_PPC64
155 *(.init.data)
156#else
14cf11af
PM
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 = .;
cabb5587 164#endif
14cf11af 165 }
cabb5587 166
14cf11af 167 . = ALIGN(16);
cabb5587 168#ifdef CONFIG_PPC32
14cf11af 169 __setup_start = .;
cabb5587
SR
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
14cf11af 181 __setup_end = .;
cabb5587 182
14cf11af 183 __initcall_start = .;
cabb5587 184#endif
14cf11af 185 .initcall.init : {
cabb5587
SR
186#ifdef CONFIG_PPC64
187 __initcall_start = .;
188#endif
14cf11af
PM
189 *(.initcall1.init)
190 *(.initcall2.init)
191 *(.initcall3.init)
192 *(.initcall4.init)
193 *(.initcall5.init)
194 *(.initcall6.init)
195 *(.initcall7.init)
cabb5587
SR
196#ifdef CONFIG_PPC64
197 __initcall_end = .;
198#endif
14cf11af 199 }
cabb5587 200#ifdef CONFIG_PPC32
14cf11af
PM
201 __initcall_end = .;
202
203 __con_initcall_start = .;
cabb5587
SR
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
14cf11af 215 __con_initcall_end = .;
cabb5587 216#endif
14cf11af
PM
217
218 SECURITY_INIT
219
cabb5587 220#ifdef CONFIG_PPC32
14cf11af
PM
221 __start___ftr_fixup = .;
222 __ftr_fixup : { *(__ftr_fixup) }
223 __stop___ftr_fixup = .;
cabb5587
SR
224#else
225 . = ALIGN(PAGE_SIZE);
226 .init.ramfs : {
227 __initramfs_start = .;
228 *(.init.ramfs)
229 __initramfs_end = .;
230 }
231#endif
14cf11af 232
cabb5587 233#ifdef CONFIG_PPC32
14cf11af
PM
234 . = ALIGN(32);
235 __per_cpu_start = .;
cabb5587
SR
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
14cf11af 247 __per_cpu_end = .;
cabb5587 248#endif
14cf11af 249
cabb5587
SR
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
14cf11af
PM
294 . = ALIGN(4096);
295 __initramfs_start = .;
cabb5587
SR
296 .init.ramfs : {
297 *(.init.ramfs)
298 }
14cf11af
PM
299 __initramfs_end = .;
300
301 . = ALIGN(4096);
302 __init_end = .;
303
304 . = ALIGN(4096);
305 _sextratext = .;
306 _eextratext = .;
307
308 __bss_start = .;
cabb5587
SR
309#endif
310 .bss : {
311#ifdef CONFIG_PPC64
312 __bss_start = .;
313#else
14cf11af
PM
314 *(.sbss) *(.scommon)
315 *(.dynbss)
cabb5587 316#endif
14cf11af 317 *(.bss)
cabb5587 318#ifdef CONFIG_PPC32
14cf11af 319 *(COMMON)
cabb5587
SR
320#else
321 __bss_stop = .;
322#endif
14cf11af 323 }
cabb5587 324#ifdef CONFIG_PPC32
14cf11af 325 __bss_stop = .;
cabb5587 326#endif
14cf11af 327
cabb5587
SR
328#ifdef CONFIG_PPC64
329 . = ALIGN(PAGE_SIZE);
330#endif
14cf11af 331 _end = . ;
cabb5587 332#ifdef CONFIG_PPC32
14cf11af 333 PROVIDE (end = .);
cabb5587 334#endif
14cf11af 335}