blob: 8b25953dc4f02022d8c939579ca7bb3bdef66777 [file] [log] [blame]
Stephen Rothwellcabb5582005-09-30 16:16:52 +10001#include <linux/config.h>
Paul Mackerrasc51e3a42005-11-05 10:36:59 +11002#ifdef CONFIG_PPC64
Stephen Rothwellcabb5582005-09-30 16:16:52 +10003#include <asm/page.h>
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +11004#define PROVIDE32(x) PROVIDE(__unused__##x)
Paul Mackerrasc51e3a42005-11-05 10:36:59 +11005#else
6#define PAGE_SIZE 4096
7#define KERNELBASE CONFIG_KERNEL_START
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +11008#define PROVIDE32(x) PROVIDE(x)
Paul Mackerrasc51e3a42005-11-05 10:36:59 +11009#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +100010#include <asm-generic/vmlinux.lds.h>
11
Michael Ellermane19e4ab2005-11-03 16:03:06 +110012ENTRY(_stext)
13
Stephen Rothwellcabb5582005-09-30 16:16:52 +100014#ifdef CONFIG_PPC64
15OUTPUT_ARCH(powerpc:common64)
16jiffies = jiffies_64;
17#else
Paul Mackerras14cf11a2005-09-26 16:04:21 +100018OUTPUT_ARCH(powerpc:common)
19jiffies = jiffies_64 + 4;
Stephen Rothwellcabb5582005-09-30 16:16:52 +100020#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +100021SECTIONS
22{
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +110023 /* Sections to be discarded. */
24 /DISCARD/ : {
25 *(.exitcall.exit)
26 *(.exit.data)
27 }
Stephen Rothwellcabb5582005-09-30 16:16:52 +100028
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +110029 . = KERNELBASE;
Stephen Rothwellcabb5582005-09-30 16:16:52 +100030
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +110031/*
32 * Text, read only data and other permanent read-only sections
33 */
34
35 /* Text and gots */
36 .text : {
37 *(.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 = .;
112 *(.initcall1.init)
113 *(.initcall2.init)
114 *(.initcall3.init)
115 *(.initcall4.init)
116 *(.initcall5.init)
117 *(.initcall6.init)
118 *(.initcall7.init)
119 __initcall_end = .;
120 }
121
122 .con_initcall.init : {
123 __con_initcall_start = .;
124 *(.con_initcall.init)
125 __con_initcall_end = .;
126 }
127
128 SECURITY_INIT
129
130 . = ALIGN(8);
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000131 __ftr_fixup : {
132 __start___ftr_fixup = .;
133 *(__ftr_fixup)
134 __stop___ftr_fixup = .;
135 }
136
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100137 . = ALIGN(PAGE_SIZE);
138 .init.ramfs : {
139 __initramfs_start = .;
140 *(.init.ramfs)
141 __initramfs_end = .;
142 }
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000143
144#ifdef CONFIG_PPC32
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100145 . = ALIGN(32);
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000146#else
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100147 . = ALIGN(128);
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000148#endif
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100149 .data.percpu : {
150 __per_cpu_start = .;
151 *(.data.percpu)
152 __per_cpu_end = .;
153 }
154
155 . = ALIGN(8);
156 .machine.desc : {
157 __machine_desc_start = . ;
158 *(.machine.desc)
159 __machine_desc_end = . ;
160 }
161
162 /* freed after init ends here */
163 . = ALIGN(PAGE_SIZE);
164 __init_end = .;
165
166/*
167 * And now the various read/write data
168 */
169
170 . = ALIGN(PAGE_SIZE);
171 _sdata = .;
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000172
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000173#ifdef CONFIG_PPC32
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100174 .data :
175 {
176 *(.data)
177 *(.sdata)
178 *(.got.plt) *(.got)
179 }
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000180#else
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100181 .data : {
182 *(.data .data.rel* .toc1)
183 *(.branch_lt)
184 }
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000185
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100186 .opd : {
187 *(.opd)
188 }
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000189
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100190 .got : {
191 __toc_start = .;
192 *(.got)
193 *(.toc)
194 }
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000195#endif
Paul Mackerras4a288562005-10-10 22:38:46 +1000196
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100197 . = ALIGN(PAGE_SIZE);
198 _edata = .;
199 PROVIDE32 (edata = .);
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000200
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100201 /* The initial task and kernel stack */
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000202#ifdef CONFIG_PPC32
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100203 . = ALIGN(8192);
204#else
205 . = ALIGN(16384);
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000206#endif
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100207 .data.init_task : {
208 *(.data.init_task)
209 }
210
211 . = ALIGN(PAGE_SIZE);
212 .data.page_aligned : {
213 *(.data.page_aligned)
214 }
215
216 .data.cacheline_aligned : {
217 *(.data.cacheline_aligned)
218 }
219
220 . = ALIGN(PAGE_SIZE);
221 __data_nosave : {
222 __nosave_begin = .;
223 *(.data.nosave)
224 . = ALIGN(PAGE_SIZE);
225 __nosave_end = .;
226 }
227
228/*
229 * And finally the bss
230 */
231
232 .bss : {
233 __bss_start = .;
234 *(.sbss) *(.scommon)
235 *(.dynbss)
236 *(.bss)
237 *(COMMON)
238 __bss_stop = .;
239 }
240
241 . = ALIGN(PAGE_SIZE);
242 _end = . ;
243 PROVIDE32 (end = .);
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000244}