Commit | Line | Data |
---|---|---|
c51e3a41 | 1 | #ifdef CONFIG_PPC64 |
cabb5587 | 2 | #include <asm/page.h> |
e8222502 | 3 | #define PROVIDE32(x) PROVIDE(__unused__##x) |
c51e3a41 PM |
4 | #else |
5 | #define PAGE_SIZE 4096 | |
6 | #define KERNELBASE CONFIG_KERNEL_START | |
e8222502 | 7 | #define PROVIDE32(x) PROVIDE(x) |
c51e3a41 | 8 | #endif |
14cf11af | 9 | #include <asm-generic/vmlinux.lds.h> |
bd67fcf9 | 10 | #include <asm/cache.h> |
14cf11af | 11 | |
e19e4ab4 ME |
12 | ENTRY(_stext) |
13 | ||
cabb5587 SR |
14 | #ifdef CONFIG_PPC64 |
15 | OUTPUT_ARCH(powerpc:common64) | |
16 | jiffies = jiffies_64; | |
17 | #else | |
14cf11af PM |
18 | OUTPUT_ARCH(powerpc:common) |
19 | jiffies = jiffies_64 + 4; | |
cabb5587 | 20 | #endif |
14cf11af PM |
21 | SECTIONS |
22 | { | |
e8222502 BH |
23 | /* Sections to be discarded. */ |
24 | /DISCARD/ : { | |
25 | *(.exitcall.exit) | |
26 | *(.exit.data) | |
27 | } | |
14cf11af | 28 | |
e8222502 | 29 | . = KERNELBASE; |
14cf11af | 30 | |
e8222502 BH |
31 | /* |
32 | * Text, read only data and other permanent read-only sections | |
33 | */ | |
34 | ||
35 | /* Text and gots */ | |
36 | .text : { | |
fd593d12 | 37 | _text = .; |
7664709b | 38 | TEXT_TEXT |
e8222502 BH |
39 | SCHED_TEXT |
40 | LOCK_TEXT | |
41 | KPROBES_TEXT | |
42 | *(.fixup) | |
14cf11af | 43 | |
e8222502 BH |
44 | #ifdef CONFIG_PPC32 |
45 | *(.got1) | |
46 | __got2_start = .; | |
47 | *(.got2) | |
48 | __got2_end = .; | |
49 | #endif /* CONFIG_PPC32 */ | |
50 | ||
51 | . = ALIGN(PAGE_SIZE); | |
52 | _etext = .; | |
53 | PROVIDE32 (etext = .); | |
54 | } | |
55 | ||
56 | /* Read-only data */ | |
57 | RODATA | |
58 | ||
59 | /* Exception & bug tables */ | |
14cf11af PM |
60 | __ex_table : { |
61 | __start___ex_table = .; | |
62 | *(__ex_table) | |
63 | __stop___ex_table = .; | |
64 | } | |
65 | ||
73c9ceab | 66 | BUG_TABLE |
14cf11af | 67 | |
e8222502 BH |
68 | /* |
69 | * Init sections discarded at runtime | |
70 | */ | |
71 | . = ALIGN(PAGE_SIZE); | |
72 | __init_begin = .; | |
73 | ||
74 | .init.text : { | |
75 | _sinittext = .; | |
76 | *(.init.text) | |
77 | _einittext = .; | |
78 | } | |
79 | ||
80 | /* .exit.text is discarded at runtime, not link time, | |
81 | * to deal with references from __bug_table | |
82 | */ | |
83 | .exit.text : { *(.exit.text) } | |
84 | ||
85 | .init.data : { | |
86 | *(.init.data); | |
87 | __vtop_table_begin = .; | |
88 | *(.vtop_fixup); | |
89 | __vtop_table_end = .; | |
90 | __ptov_table_begin = .; | |
91 | *(.ptov_fixup); | |
92 | __ptov_table_end = .; | |
c4e3ea25 SR |
93 | #ifdef CONFIG_PPC_ISERIES |
94 | __dt_strings_start = .; | |
95 | *(.dt_strings); | |
96 | __dt_strings_end = .; | |
97 | #endif | |
e8222502 BH |
98 | } |
99 | ||
100 | . = ALIGN(16); | |
101 | .init.setup : { | |
102 | __setup_start = .; | |
103 | *(.init.setup) | |
104 | __setup_end = .; | |
105 | } | |
106 | ||
107 | .initcall.init : { | |
108 | __initcall_start = .; | |
61ce1efe | 109 | INITCALLS |
e8222502 BH |
110 | __initcall_end = .; |
111 | } | |
112 | ||
113 | .con_initcall.init : { | |
114 | __con_initcall_start = .; | |
115 | *(.con_initcall.init) | |
116 | __con_initcall_end = .; | |
117 | } | |
118 | ||
119 | SECURITY_INIT | |
120 | ||
121 | . = ALIGN(8); | |
cabb5587 SR |
122 | __ftr_fixup : { |
123 | __start___ftr_fixup = .; | |
124 | *(__ftr_fixup) | |
125 | __stop___ftr_fixup = .; | |
126 | } | |
3f639ee8 SR |
127 | #ifdef CONFIG_PPC64 |
128 | . = ALIGN(8); | |
129 | __fw_ftr_fixup : { | |
130 | __start___fw_ftr_fixup = .; | |
131 | *(__fw_ftr_fixup) | |
132 | __stop___fw_ftr_fixup = .; | |
133 | } | |
134 | #endif | |
67d38229 | 135 | #ifdef CONFIG_BLK_DEV_INITRD |
e8222502 BH |
136 | . = ALIGN(PAGE_SIZE); |
137 | .init.ramfs : { | |
138 | __initramfs_start = .; | |
139 | *(.init.ramfs) | |
140 | __initramfs_end = .; | |
141 | } | |
67d38229 | 142 | #endif |
b6e3590f | 143 | . = ALIGN(PAGE_SIZE); |
e8222502 BH |
144 | .data.percpu : { |
145 | __per_cpu_start = .; | |
146 | *(.data.percpu) | |
5fb7dc37 | 147 | *(.data.percpu.shared_aligned) |
e8222502 BH |
148 | __per_cpu_end = .; |
149 | } | |
14cf11af | 150 | |
e8222502 BH |
151 | . = ALIGN(8); |
152 | .machine.desc : { | |
153 | __machine_desc_start = . ; | |
154 | *(.machine.desc) | |
155 | __machine_desc_end = . ; | |
156 | } | |
157 | ||
158 | /* freed after init ends here */ | |
159 | . = ALIGN(PAGE_SIZE); | |
160 | __init_end = .; | |
161 | ||
162 | /* | |
163 | * And now the various read/write data | |
164 | */ | |
165 | ||
166 | . = ALIGN(PAGE_SIZE); | |
167 | _sdata = .; | |
14cf11af | 168 | |
cabb5587 | 169 | #ifdef CONFIG_PPC32 |
e8222502 BH |
170 | .data : |
171 | { | |
ca967258 | 172 | DATA_DATA |
e8222502 BH |
173 | *(.sdata) |
174 | *(.got.plt) *(.got) | |
175 | } | |
cabb5587 | 176 | #else |
e8222502 BH |
177 | .data : { |
178 | *(.data .data.rel* .toc1) | |
179 | *(.branch_lt) | |
180 | } | |
14cf11af | 181 | |
e8222502 BH |
182 | .opd : { |
183 | *(.opd) | |
184 | } | |
185 | ||
186 | .got : { | |
187 | __toc_start = .; | |
188 | *(.got) | |
189 | *(.toc) | |
190 | } | |
cabb5587 | 191 | #endif |
14cf11af | 192 | |
e8222502 BH |
193 | . = ALIGN(PAGE_SIZE); |
194 | _edata = .; | |
195 | PROVIDE32 (edata = .); | |
196 | ||
197 | /* The initial task and kernel stack */ | |
198 | #ifdef CONFIG_PPC32 | |
199 | . = ALIGN(8192); | |
cabb5587 | 200 | #else |
e8222502 BH |
201 | . = ALIGN(16384); |
202 | #endif | |
203 | .data.init_task : { | |
204 | *(.data.init_task) | |
205 | } | |
14cf11af | 206 | |
e8222502 BH |
207 | . = ALIGN(PAGE_SIZE); |
208 | .data.page_aligned : { | |
209 | *(.data.page_aligned) | |
210 | } | |
14cf11af | 211 | |
e8222502 BH |
212 | .data.cacheline_aligned : { |
213 | *(.data.cacheline_aligned) | |
214 | } | |
14cf11af | 215 | |
bd67fcf9 TB |
216 | . = ALIGN(L1_CACHE_BYTES); |
217 | .data.read_mostly : { | |
218 | *(.data.read_mostly) | |
219 | } | |
220 | ||
e8222502 BH |
221 | . = ALIGN(PAGE_SIZE); |
222 | __data_nosave : { | |
223 | __nosave_begin = .; | |
224 | *(.data.nosave) | |
225 | . = ALIGN(PAGE_SIZE); | |
226 | __nosave_end = .; | |
227 | } | |
4a288563 | 228 | |
e8222502 BH |
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 | } | |
14cf11af | 241 | |
e8222502 BH |
242 | . = ALIGN(PAGE_SIZE); |
243 | _end = . ; | |
244 | PROVIDE32 (end = .); | |
14cf11af | 245 | } |