blob: 04b98671a0608d6ced7470712291bde24d3e01ac [file] [log] [blame]
Paul Mackerrasc51e3a42005-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 Mackerrasc51e3a42005-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 Mackerrasc51e3a42005-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 : {
Eric W. Biedermanfd593d12006-12-07 02:14:04 +010036 _text = .;
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +110037 *(.text .text.*)
38 SCHED_TEXT
39 LOCK_TEXT
40 KPROBES_TEXT
41 *(.fixup)
42
Stephen Rothwellcabb5582005-09-30 16:16:52 +100043#ifdef CONFIG_PPC32
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +110044 *(.got1)
45 __got2_start = .;
46 *(.got2)
47 __got2_end = .;
48#endif /* CONFIG_PPC32 */
Paul Mackerras14cf11a2005-09-26 16:04:21 +100049
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +110050 . = ALIGN(PAGE_SIZE);
51 _etext = .;
52 PROVIDE32 (etext = .);
53 }
Paul Mackerras14cf11a2005-09-26 16:04:21 +100054
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +110055 /* Read-only data */
56 RODATA
Paul Mackerras14cf11a2005-09-26 16:04:21 +100057
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +110058 /* Exception & bug tables */
Paul Mackerras14cf11a2005-09-26 16:04:21 +100059 __ex_table : {
60 __start___ex_table = .;
61 *(__ex_table)
62 __stop___ex_table = .;
63 }
64
65 __bug_table : {
66 __start___bug_table = .;
67 *(__bug_table)
68 __stop___bug_table = .;
69 }
70
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +110071/*
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 : { *(.exit.text) }
87
88 .init.data : {
89 *(.init.data);
90 __vtop_table_begin = .;
91 *(.vtop_fixup);
92 __vtop_table_end = .;
93 __ptov_table_begin = .;
94 *(.ptov_fixup);
95 __ptov_table_end = .;
Stephen Rothwellc4e3ea22006-05-19 17:04:48 +100096#ifdef CONFIG_PPC_ISERIES
97 __dt_strings_start = .;
98 *(.dt_strings);
99 __dt_strings_end = .;
100#endif
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100101 }
102
103 . = ALIGN(16);
104 .init.setup : {
105 __setup_start = .;
106 *(.init.setup)
107 __setup_end = .;
108 }
109
110 .initcall.init : {
111 __initcall_start = .;
Andrew Morton61ce1ef2006-10-27 11:41:44 -0700112 INITCALLS
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100113 __initcall_end = .;
114 }
115
116 .con_initcall.init : {
117 __con_initcall_start = .;
118 *(.con_initcall.init)
119 __con_initcall_end = .;
120 }
121
122 SECURITY_INIT
123
124 . = ALIGN(8);
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000125 __ftr_fixup : {
126 __start___ftr_fixup = .;
127 *(__ftr_fixup)
128 __stop___ftr_fixup = .;
129 }
Stephen Rothwell3f639ee2006-09-25 18:19:00 +1000130#ifdef CONFIG_PPC64
131 . = ALIGN(8);
132 __fw_ftr_fixup : {
133 __start___fw_ftr_fixup = .;
134 *(__fw_ftr_fixup)
135 __stop___fw_ftr_fixup = .;
136 }
137#endif
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000138
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100139 . = ALIGN(PAGE_SIZE);
140 .init.ramfs : {
141 __initramfs_start = .;
142 *(.init.ramfs)
143 __initramfs_end = .;
144 }
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000145
146#ifdef CONFIG_PPC32
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100147 . = ALIGN(32);
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000148#else
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100149 . = ALIGN(128);
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000150#endif
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100151 .data.percpu : {
152 __per_cpu_start = .;
153 *(.data.percpu)
154 __per_cpu_end = .;
155 }
156
157 . = ALIGN(8);
158 .machine.desc : {
159 __machine_desc_start = . ;
160 *(.machine.desc)
161 __machine_desc_end = . ;
162 }
163
164 /* freed after init ends here */
165 . = ALIGN(PAGE_SIZE);
166 __init_end = .;
167
168/*
169 * And now the various read/write data
170 */
171
172 . = ALIGN(PAGE_SIZE);
173 _sdata = .;
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000174
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000175#ifdef CONFIG_PPC32
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100176 .data :
177 {
178 *(.data)
179 *(.sdata)
180 *(.got.plt) *(.got)
181 }
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000182#else
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100183 .data : {
184 *(.data .data.rel* .toc1)
185 *(.branch_lt)
186 }
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000187
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100188 .opd : {
189 *(.opd)
190 }
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000191
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100192 .got : {
193 __toc_start = .;
194 *(.got)
195 *(.toc)
196 }
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000197#endif
Paul Mackerras4a288562005-10-10 22:38:46 +1000198
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100199 . = ALIGN(PAGE_SIZE);
200 _edata = .;
201 PROVIDE32 (edata = .);
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000202
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100203 /* The initial task and kernel stack */
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000204#ifdef CONFIG_PPC32
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100205 . = ALIGN(8192);
206#else
207 . = ALIGN(16384);
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000208#endif
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100209 .data.init_task : {
210 *(.data.init_task)
211 }
212
213 . = ALIGN(PAGE_SIZE);
214 .data.page_aligned : {
215 *(.data.page_aligned)
216 }
217
218 .data.cacheline_aligned : {
219 *(.data.cacheline_aligned)
220 }
221
222 . = ALIGN(PAGE_SIZE);
223 __data_nosave : {
224 __nosave_begin = .;
225 *(.data.nosave)
226 . = ALIGN(PAGE_SIZE);
227 __nosave_end = .;
228 }
229
230/*
231 * And finally the bss
232 */
233
234 .bss : {
235 __bss_start = .;
236 *(.sbss) *(.scommon)
237 *(.dynbss)
238 *(.bss)
239 *(COMMON)
240 __bss_stop = .;
241 }
242
243 . = ALIGN(PAGE_SIZE);
244 _end = . ;
245 PROVIDE32 (end = .);
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000246}