1#ifdef CONFIG_PPC64
2#include <asm/page.h>
3#define PROVIDE32(x)	PROVIDE(__unused__##x)
4#else
5#define PAGE_SIZE	4096
6#define KERNELBASE	CONFIG_KERNEL_START
7#define PROVIDE32(x)	PROVIDE(x)
8#endif
9#include <asm-generic/vmlinux.lds.h>
10#include <asm/cache.h>
11
12ENTRY(_stext)
13
14#ifdef CONFIG_PPC64
15OUTPUT_ARCH(powerpc:common64)
16jiffies = jiffies_64;
17#else
18OUTPUT_ARCH(powerpc:common)
19jiffies = jiffies_64 + 4;
20#endif
21SECTIONS
22{
23	/* Sections to be discarded. */
24	/DISCARD/ : {
25	*(.exitcall.exit)
26	EXIT_DATA
27	}
28
29	. = KERNELBASE;
30
31/*
32 * Text, read only data and other permanent read-only sections
33 */
34
35	/* Text and gots */
36	.text : {
37		ALIGN_FUNCTION();
38		*(.text.head)
39		_text = .;
40		*(.text .fixup .text.init.refok .exit.text.refok)
41		SCHED_TEXT
42		LOCK_TEXT
43		KPROBES_TEXT
44
45#ifdef CONFIG_PPC32
46		*(.got1)
47		__got2_start = .;
48		*(.got2)
49		__got2_end = .;
50#endif /* CONFIG_PPC32 */
51
52		. = ALIGN(PAGE_SIZE);
53		_etext = .;
54		PROVIDE32 (etext = .);
55	}
56
57	/* Read-only data */
58	RODATA
59
60	/* Exception & bug tables */
61	__ex_table : {
62		__start___ex_table = .;
63		*(__ex_table)
64		__stop___ex_table = .;
65	}
66
67	NOTES
68
69	BUG_TABLE
70
71/*
72 * Init sections discarded at runtime
73 */
74	. = ALIGN(PAGE_SIZE);
75	__init_begin = .;
76
77	.init.text : {
78		_sinittext = .;
79		INIT_TEXT
80		_einittext = .;
81	}
82
83	/* .exit.text is discarded at runtime, not link time,
84	 * to deal with references from __bug_table
85	 */
86	.exit.text : {
87		EXIT_TEXT
88	}
89
90	.init.data : {
91		INIT_DATA
92		__vtop_table_begin = .;
93		*(.vtop_fixup);
94		__vtop_table_end = .;
95		__ptov_table_begin = .;
96		*(.ptov_fixup);
97		__ptov_table_end = .;
98#ifdef CONFIG_PPC_ISERIES
99		__dt_strings_start = .;
100		*(.dt_strings);
101		__dt_strings_end = .;
102#endif
103	}
104
105	. = ALIGN(16);
106	.init.setup : {
107		__setup_start = .;
108		*(.init.setup)
109		__setup_end = .;
110	}
111
112	.initcall.init : {
113		__initcall_start = .;
114		INITCALLS
115		__initcall_end = .;
116		}
117
118	.con_initcall.init : {
119		__con_initcall_start = .;
120		*(.con_initcall.init)
121		__con_initcall_end = .;
122	}
123
124	SECURITY_INIT
125
126	. = ALIGN(8);
127	__ftr_fixup : {
128		__start___ftr_fixup = .;
129		*(__ftr_fixup)
130		__stop___ftr_fixup = .;
131	}
132#ifdef CONFIG_PPC64
133	. = ALIGN(8);
134	__fw_ftr_fixup : {
135		__start___fw_ftr_fixup = .;
136		*(__fw_ftr_fixup)
137		__stop___fw_ftr_fixup = .;
138	}
139#endif
140#ifdef CONFIG_BLK_DEV_INITRD
141	. = ALIGN(PAGE_SIZE);
142	.init.ramfs : {
143		__initramfs_start = .;
144		*(.init.ramfs)
145		__initramfs_end = .;
146	}
147#endif
148	. = ALIGN(PAGE_SIZE);
149	.data.percpu : {
150		__per_cpu_start = .;
151		*(.data.percpu)
152		*(.data.percpu.shared_aligned)
153		__per_cpu_end = .;
154	}
155
156	. = ALIGN(8);
157	.machine.desc : {
158		__machine_desc_start = . ;
159		*(.machine.desc)
160		__machine_desc_end = . ;
161	}
162
163	/* freed after init ends here */
164	. = ALIGN(PAGE_SIZE);
165	__init_end = .;
166
167/*
168 * And now the various read/write data
169 */
170
171	. = ALIGN(PAGE_SIZE);
172	_sdata = .;
173
174#ifdef CONFIG_PPC32
175	.data    :
176	{
177		DATA_DATA
178		*(.sdata)
179		*(.got.plt) *(.got)
180	}
181#else
182	.data : {
183		DATA_DATA
184		*(.data.rel*)
185		*(.toc1)
186		*(.branch_lt)
187	}
188
189	.opd : {
190		*(.opd)
191	}
192
193	.got : {
194		__toc_start = .;
195		*(.got)
196		*(.toc)
197	}
198#endif
199
200	. = ALIGN(PAGE_SIZE);
201	_edata  =  .;
202	PROVIDE32 (edata = .);
203
204	/* The initial task and kernel stack */
205#ifdef CONFIG_PPC32
206	. = ALIGN(8192);
207#else
208	. = ALIGN(16384);
209#endif
210	.data.init_task : {
211		*(.data.init_task)
212	}
213
214	. = ALIGN(PAGE_SIZE);
215	.data.page_aligned : {
216		*(.data.page_aligned)
217	}
218
219	.data.cacheline_aligned : {
220		*(.data.cacheline_aligned)
221	}
222
223	. = ALIGN(L1_CACHE_BYTES);
224	.data.read_mostly : {
225		*(.data.read_mostly)
226	}
227
228	. = ALIGN(PAGE_SIZE);
229	__data_nosave : {
230		__nosave_begin = .;
231		*(.data.nosave)
232		. = ALIGN(PAGE_SIZE);
233		__nosave_end = .;
234	}
235
236/*
237 * And finally the bss
238 */
239
240	.bss : {
241		__bss_start = .;
242		*(.sbss) *(.scommon)
243		*(.dynbss)
244		*(.bss)
245		*(COMMON)
246		__bss_stop = .;
247	}
248
249	. = ALIGN(PAGE_SIZE);
250	_end = . ;
251	PROVIDE32 (end = .);
252}
253