Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 1 | #include <linux/config.h> |
2 | #ifdef CONFIG_PPC64 | ||||
3 | #include <asm/page.h> | ||||
Paul Mackerras | 4a28856 | 2005-10-10 22:38:46 +1000 | [diff] [blame^] | 4 | #else |
5 | #define PAGE_SIZE 4096 | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 6 | #endif |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 7 | #include <asm-generic/vmlinux.lds.h> |
8 | |||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 9 | #ifdef CONFIG_PPC64 |
10 | OUTPUT_ARCH(powerpc:common64) | ||||
11 | jiffies = jiffies_64; | ||||
12 | #else | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 13 | OUTPUT_ARCH(powerpc:common) |
14 | jiffies = jiffies_64 + 4; | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 15 | #endif |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 16 | SECTIONS |
17 | { | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 18 | /* Sections to be discarded. */ |
19 | /DISCARD/ : { | ||||
20 | *(.exitcall.exit) | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 21 | *(.exit.data) |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 22 | } |
23 | |||||
24 | |||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 25 | /* Read-only sections, merged into text segment: */ |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 26 | #ifdef CONFIG_PPC32 |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 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) } | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 50 | #endif |
51 | .text : { | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 52 | *(.text .text.*) |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 53 | SCHED_TEXT |
54 | LOCK_TEXT | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 55 | KPROBES_TEXT |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 56 | *(.fixup) |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 57 | #ifdef CONFIG_PPC32 |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 58 | *(.got1) |
59 | __got2_start = .; | ||||
60 | *(.got2) | ||||
61 | __got2_end = .; | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 62 | #else |
63 | . = ALIGN(PAGE_SIZE); | ||||
64 | _etext = .; | ||||
65 | #endif | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 66 | } |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 67 | #ifdef CONFIG_PPC32 |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 68 | _etext = .; |
69 | PROVIDE (etext = .); | ||||
70 | |||||
71 | RODATA | ||||
72 | .fini : { *(.fini) } =0 | ||||
73 | .ctors : { *(.ctors) } | ||||
74 | .dtors : { *(.dtors) } | ||||
75 | |||||
76 | .fixup : { *(.fixup) } | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 77 | #endif |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 78 | |
79 | __ex_table : { | ||||
80 | __start___ex_table = .; | ||||
81 | *(__ex_table) | ||||
82 | __stop___ex_table = .; | ||||
83 | } | ||||
84 | |||||
85 | __bug_table : { | ||||
86 | __start___bug_table = .; | ||||
87 | *(__bug_table) | ||||
88 | __stop___bug_table = .; | ||||
89 | } | ||||
90 | |||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 91 | #ifdef CONFIG_PPC64 |
92 | __ftr_fixup : { | ||||
93 | __start___ftr_fixup = .; | ||||
94 | *(__ftr_fixup) | ||||
95 | __stop___ftr_fixup = .; | ||||
96 | } | ||||
97 | |||||
98 | RODATA | ||||
99 | #endif | ||||
100 | |||||
101 | #ifdef CONFIG_PPC32 | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 102 | /* Read-write section, merged into data segment: */ |
Paul Mackerras | 4a28856 | 2005-10-10 22:38:46 +1000 | [diff] [blame^] | 103 | . = ALIGN(PAGE_SIZE); |
Paul Mackerras | c16ff7e | 2005-10-06 13:28:31 +1000 | [diff] [blame] | 104 | _sdata = .; |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 105 | .data : |
106 | { | ||||
107 | *(.data) | ||||
108 | *(.data1) | ||||
109 | *(.sdata) | ||||
110 | *(.sdata2) | ||||
111 | *(.got.plt) *(.got) | ||||
112 | *(.dynamic) | ||||
113 | CONSTRUCTORS | ||||
114 | } | ||||
115 | |||||
Paul Mackerras | 4a28856 | 2005-10-10 22:38:46 +1000 | [diff] [blame^] | 116 | . = ALIGN(PAGE_SIZE); |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 117 | __nosave_begin = .; |
118 | .data_nosave : { *(.data.nosave) } | ||||
Paul Mackerras | 4a28856 | 2005-10-10 22:38:46 +1000 | [diff] [blame^] | 119 | . = ALIGN(PAGE_SIZE); |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 120 | __nosave_end = .; |
121 | |||||
122 | . = ALIGN(32); | ||||
123 | .data.cacheline_aligned : { *(.data.cacheline_aligned) } | ||||
124 | |||||
125 | _edata = .; | ||||
126 | PROVIDE (edata = .); | ||||
127 | |||||
128 | . = ALIGN(8192); | ||||
129 | .data.init_task : { *(.data.init_task) } | ||||
Paul Mackerras | 4a28856 | 2005-10-10 22:38:46 +1000 | [diff] [blame^] | 130 | #endif |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 131 | |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 132 | /* will be freed after init */ |
133 | . = ALIGN(PAGE_SIZE); | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 134 | __init_begin = .; |
135 | .init.text : { | ||||
136 | _sinittext = .; | ||||
137 | *(.init.text) | ||||
138 | _einittext = .; | ||||
139 | } | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 140 | #ifdef CONFIG_PPC32 |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 141 | /* .exit.text is discarded at runtime, not link time, |
142 | to deal with references from __bug_table */ | ||||
143 | .exit.text : { *(.exit.text) } | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 144 | #endif |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 145 | .init.data : { |
146 | *(.init.data); | ||||
147 | __vtop_table_begin = .; | ||||
148 | *(.vtop_fixup); | ||||
149 | __vtop_table_end = .; | ||||
150 | __ptov_table_begin = .; | ||||
151 | *(.ptov_fixup); | ||||
152 | __ptov_table_end = .; | ||||
153 | } | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 154 | |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 155 | . = ALIGN(16); |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 156 | .init.setup : { |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 157 | __setup_start = .; |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 158 | *(.init.setup) |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 159 | __setup_end = .; |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 160 | } |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 161 | |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 162 | .initcall.init : { |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 163 | __initcall_start = .; |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 164 | *(.initcall1.init) |
165 | *(.initcall2.init) | ||||
166 | *(.initcall3.init) | ||||
167 | *(.initcall4.init) | ||||
168 | *(.initcall5.init) | ||||
169 | *(.initcall6.init) | ||||
170 | *(.initcall7.init) | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 171 | __initcall_end = .; |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 172 | } |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 173 | |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 174 | .con_initcall.init : { |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 175 | __con_initcall_start = .; |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 176 | *(.con_initcall.init) |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 177 | __con_initcall_end = .; |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 178 | } |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 179 | |
180 | SECURITY_INIT | ||||
181 | |||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 182 | #ifdef CONFIG_PPC32 |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 183 | __start___ftr_fixup = .; |
184 | __ftr_fixup : { *(__ftr_fixup) } | ||||
185 | __stop___ftr_fixup = .; | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 186 | #else |
187 | . = ALIGN(PAGE_SIZE); | ||||
188 | .init.ramfs : { | ||||
189 | __initramfs_start = .; | ||||
190 | *(.init.ramfs) | ||||
191 | __initramfs_end = .; | ||||
192 | } | ||||
193 | #endif | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 194 | |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 195 | #ifdef CONFIG_PPC32 |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 196 | . = ALIGN(32); |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 197 | #endif |
198 | .data.percpu : { | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 199 | __per_cpu_start = .; |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 200 | *(.data.percpu) |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 201 | __per_cpu_end = .; |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 202 | } |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 203 | |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 204 | . = ALIGN(PAGE_SIZE); |
Paul Mackerras | 4a28856 | 2005-10-10 22:38:46 +1000 | [diff] [blame^] | 205 | #ifdef CONFIG_PPC64 |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 206 | . = ALIGN(16384); |
207 | __init_end = .; | ||||
208 | /* freed after init ends here */ | ||||
209 | |||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 210 | /* Read/write sections */ |
211 | . = ALIGN(PAGE_SIZE); | ||||
212 | . = ALIGN(16384); | ||||
Paul Mackerras | 4a28856 | 2005-10-10 22:38:46 +1000 | [diff] [blame^] | 213 | _sdata = .; |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 214 | /* The initial task and kernel stack */ |
215 | .data.init_task : { | ||||
216 | *(.data.init_task) | ||||
217 | } | ||||
218 | |||||
219 | . = ALIGN(PAGE_SIZE); | ||||
220 | .data.page_aligned : { | ||||
221 | *(.data.page_aligned) | ||||
222 | } | ||||
223 | |||||
224 | .data.cacheline_aligned : { | ||||
225 | *(.data.cacheline_aligned) | ||||
226 | } | ||||
227 | |||||
228 | .data : { | ||||
229 | *(.data .data.rel* .toc1) | ||||
230 | *(.branch_lt) | ||||
231 | } | ||||
232 | |||||
233 | .opd : { | ||||
234 | *(.opd) | ||||
235 | } | ||||
236 | |||||
237 | .got : { | ||||
238 | __toc_start = .; | ||||
239 | *(.got) | ||||
240 | *(.toc) | ||||
241 | . = ALIGN(PAGE_SIZE); | ||||
242 | _edata = .; | ||||
243 | } | ||||
244 | |||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 245 | . = ALIGN(PAGE_SIZE); |
246 | #else | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 247 | __initramfs_start = .; |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 248 | .init.ramfs : { |
249 | *(.init.ramfs) | ||||
250 | } | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 251 | __initramfs_end = .; |
252 | |||||
253 | . = ALIGN(4096); | ||||
254 | __init_end = .; | ||||
255 | |||||
256 | . = ALIGN(4096); | ||||
257 | _sextratext = .; | ||||
258 | _eextratext = .; | ||||
259 | |||||
260 | __bss_start = .; | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 261 | #endif |
Paul Mackerras | 4a28856 | 2005-10-10 22:38:46 +1000 | [diff] [blame^] | 262 | |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 263 | .bss : { |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 264 | __bss_start = .; |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 265 | *(.sbss) *(.scommon) |
266 | *(.dynbss) | ||||
267 | *(.bss) | ||||
268 | *(COMMON) | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 269 | __bss_stop = .; |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 270 | } |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 271 | |
272 | #ifdef CONFIG_PPC64 | ||||
273 | . = ALIGN(PAGE_SIZE); | ||||
274 | #endif | ||||
275 | _end = . ; | ||||
276 | #ifdef CONFIG_PPC32 | ||||
277 | PROVIDE (end = .); | ||||
278 | #endif | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 279 | } |