blob: e8342d86753675d0ad20b3866bcdb12165d30d49 [file] [log] [blame]
Paul Mackerrasc51e3a412005-11-05 10:36:59 +11001#ifdef CONFIG_PPC64
Stephen Rothwellcabb5582005-09-30 16:16:52 +10002#include <asm/page.h>
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +11003#define PROVIDE32(x) PROVIDE(__unused__##x)
Paul Mackerrasc51e3a412005-11-05 10:36:59 +11004#else
5#define PAGE_SIZE 4096
6#define KERNELBASE CONFIG_KERNEL_START
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +11007#define PROVIDE32(x) PROVIDE(x)
Paul Mackerrasc51e3a412005-11-05 10:36:59 +11008#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +10009#include <asm-generic/vmlinux.lds.h>
10
Michael Ellermane19e4ab2005-11-03 16:03:06 +110011ENTRY(_stext)
12
Stephen Rothwellcabb5582005-09-30 16:16:52 +100013#ifdef CONFIG_PPC64
14OUTPUT_ARCH(powerpc:common64)
15jiffies = jiffies_64;
16#else
Paul Mackerras14cf11a2005-09-26 16:04:21 +100017OUTPUT_ARCH(powerpc:common)
18jiffies = jiffies_64 + 4;
Stephen Rothwellcabb5582005-09-30 16:16:52 +100019#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +100020SECTIONS
21{
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +110022 /* Sections to be discarded. */
23 /DISCARD/ : {
24 *(.exitcall.exit)
25 *(.exit.data)
26 }
Stephen Rothwellcabb5582005-09-30 16:16:52 +100027
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +110028 . = KERNELBASE;
Stephen Rothwellcabb5582005-09-30 16:16:52 +100029
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +110030/*
31 * Text, read only data and other permanent read-only sections
32 */
33
34 /* Text and gots */
35 .text : {
36 *(.text .text.*)
37 SCHED_TEXT
38 LOCK_TEXT
39 KPROBES_TEXT
40 *(.fixup)
41
Stephen Rothwellcabb5582005-09-30 16:16:52 +100042#ifdef CONFIG_PPC32
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +110043 *(.got1)
44 __got2_start = .;
45 *(.got2)
46 __got2_end = .;
47#endif /* CONFIG_PPC32 */
Paul Mackerras14cf11a2005-09-26 16:04:21 +100048
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +110049 . = ALIGN(PAGE_SIZE);
50 _etext = .;
51 PROVIDE32 (etext = .);
52 }
Paul Mackerras14cf11a2005-09-26 16:04:21 +100053
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +110054 /* Read-only data */
55 RODATA
Paul Mackerras14cf11a2005-09-26 16:04:21 +100056
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +110057 /* Exception & bug tables */
Paul Mackerras14cf11a2005-09-26 16:04:21 +100058 __ex_table : {
59 __start___ex_table = .;
60 *(__ex_table)
61 __stop___ex_table = .;
62 }
63
64 __bug_table : {
65 __start___bug_table = .;
66 *(__bug_table)
67 __stop___bug_table = .;
68 }
69
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +110070/*
71 * Init sections discarded at runtime
72 */
73 . = ALIGN(PAGE_SIZE);
74 __init_begin = .;
75
76 .init.text : {
77 _sinittext = .;
78 *(.init.text)
79 _einittext = .;
80 }
81
82 /* .exit.text is discarded at runtime, not link time,
83 * to deal with references from __bug_table
84 */
85 .exit.text : { *(.exit.text) }
86
87 .init.data : {
88 *(.init.data);
89 __vtop_table_begin = .;
90 *(.vtop_fixup);
91 __vtop_table_end = .;
92 __ptov_table_begin = .;
93 *(.ptov_fixup);
94 __ptov_table_end = .;
Stephen Rothwellc4e3ea22006-05-19 17:04:48 +100095#ifdef CONFIG_PPC_ISERIES
96 __dt_strings_start = .;
97 *(.dt_strings);
98 __dt_strings_end = .;
99#endif
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100100 }
101
102 . = ALIGN(16);
103 .init.setup : {
104 __setup_start = .;
105 *(.init.setup)
106 __setup_end = .;
107 }
108
109 .initcall.init : {
110 __initcall_start = .;
Andrew Morton61ce1ef2006-10-27 11:41:44 -0700111 INITCALLS
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100112 __initcall_end = .;
113 }
114
115 .con_initcall.init : {
116 __con_initcall_start = .;
117 *(.con_initcall.init)
118 __con_initcall_end = .;
119 }
120
121 SECURITY_INIT
122
123 . = ALIGN(8);
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000124 __ftr_fixup : {
125 __start___ftr_fixup = .;
126 *(__ftr_fixup)
127 __stop___ftr_fixup = .;
128 }
Stephen Rothwell3f639ee2006-09-25 18:19:00 +1000129#ifdef CONFIG_PPC64
130 . = ALIGN(8);
131 __fw_ftr_fixup : {
132 __start___fw_ftr_fixup = .;
133 *(__fw_ftr_fixup)
134 __stop___fw_ftr_fixup = .;
135 }
136#endif
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000137
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100138 . = ALIGN(PAGE_SIZE);
139 .init.ramfs : {
140 __initramfs_start = .;
141 *(.init.ramfs)
142 __initramfs_end = .;
143 }
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000144
145#ifdef CONFIG_PPC32
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100146 . = ALIGN(32);
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000147#else
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100148 . = ALIGN(128);
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000149#endif
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100150 .data.percpu : {
151 __per_cpu_start = .;
152 *(.data.percpu)
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 = .;
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000173
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000174#ifdef CONFIG_PPC32
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100175 .data :
176 {
177 *(.data)
178 *(.sdata)
179 *(.got.plt) *(.got)
180 }
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000181#else
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100182 .data : {
183 *(.data .data.rel* .toc1)
184 *(.branch_lt)
185 }
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000186
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100187 .opd : {
188 *(.opd)
189 }
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000190
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100191 .got : {
192 __toc_start = .;
193 *(.got)
194 *(.toc)
195 }
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000196#endif
Paul Mackerras4a288562005-10-10 22:38:46 +1000197
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100198 . = ALIGN(PAGE_SIZE);
199 _edata = .;
200 PROVIDE32 (edata = .);
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000201
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100202 /* The initial task and kernel stack */
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000203#ifdef CONFIG_PPC32
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100204 . = ALIGN(8192);
205#else
206 . = ALIGN(16384);
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000207#endif
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100208 .data.init_task : {
209 *(.data.init_task)
210 }
211
212 . = ALIGN(PAGE_SIZE);
213 .data.page_aligned : {
214 *(.data.page_aligned)
215 }
216
217 .data.cacheline_aligned : {
218 *(.data.cacheline_aligned)
219 }
220
221 . = ALIGN(PAGE_SIZE);
222 __data_nosave : {
223 __nosave_begin = .;
224 *(.data.nosave)
225 . = ALIGN(PAGE_SIZE);
226 __nosave_end = .;
227 }
228
229/*
230 * And finally the bss
231 */
232
233 .bss : {
234 __bss_start = .;
235 *(.sbss) *(.scommon)
236 *(.dynbss)
237 *(.bss)
238 *(COMMON)
239 __bss_stop = .;
240 }
241
242 . = ALIGN(PAGE_SIZE);
243 _end = . ;
244 PROVIDE32 (end = .);
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000245}