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