Paul Mackerras | c51e3a41 | 2005-11-05 10:36:59 +1100 | [diff] [blame] | 1 | #ifdef CONFIG_PPC64 |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 2 | #include <asm/page.h> |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 3 | #define PROVIDE32(x) PROVIDE(__unused__##x) |
Paul Mackerras | c51e3a41 | 2005-11-05 10:36:59 +1100 | [diff] [blame] | 4 | #else |
5 | #define PAGE_SIZE 4096 | ||||
6 | #define KERNELBASE CONFIG_KERNEL_START | ||||
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 7 | #define PROVIDE32(x) PROVIDE(x) |
Paul Mackerras | c51e3a41 | 2005-11-05 10:36:59 +1100 | [diff] [blame] | 8 | #endif |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 9 | #include <asm-generic/vmlinux.lds.h> |
10 | |||||
Michael Ellerman | e19e4ab | 2005-11-03 16:03:06 +1100 | [diff] [blame] | 11 | ENTRY(_stext) |
12 | |||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 13 | #ifdef CONFIG_PPC64 |
14 | OUTPUT_ARCH(powerpc:common64) | ||||
15 | jiffies = jiffies_64; | ||||
16 | #else | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 17 | OUTPUT_ARCH(powerpc:common) |
18 | jiffies = jiffies_64 + 4; | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 19 | #endif |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 20 | SECTIONS |
21 | { | ||||
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 22 | /* Sections to be discarded. */ |
23 | /DISCARD/ : { | ||||
24 | *(.exitcall.exit) | ||||
25 | *(.exit.data) | ||||
26 | } | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 27 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 28 | . = KERNELBASE; |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 29 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 30 | /* |
31 | * Text, read only data and other permanent read-only sections | ||||
32 | */ | ||||
33 | |||||
34 | /* Text and gots */ | ||||
35 | .text : { | ||||
36 | *(.text .text.*) | ||||
37 | SCHED_TEXT | ||||
38 | LOCK_TEXT | ||||
39 | KPROBES_TEXT | ||||
40 | *(.fixup) | ||||
41 | |||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 42 | #ifdef CONFIG_PPC32 |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 43 | *(.got1) |
44 | __got2_start = .; | ||||
45 | *(.got2) | ||||
46 | __got2_end = .; | ||||
47 | #endif /* CONFIG_PPC32 */ | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 48 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 49 | . = ALIGN(PAGE_SIZE); |
50 | _etext = .; | ||||
51 | PROVIDE32 (etext = .); | ||||
52 | } | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 53 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 54 | /* Read-only data */ |
55 | RODATA | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 56 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 57 | /* Exception & bug tables */ |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 58 | __ex_table : { |
59 | __start___ex_table = .; | ||||
60 | *(__ex_table) | ||||
61 | __stop___ex_table = .; | ||||
62 | } | ||||
63 | |||||
64 | __bug_table : { | ||||
65 | __start___bug_table = .; | ||||
66 | *(__bug_table) | ||||
67 | __stop___bug_table = .; | ||||
68 | } | ||||
69 | |||||
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 70 | /* |
71 | * Init sections discarded at runtime | ||||
72 | */ | ||||
73 | . = ALIGN(PAGE_SIZE); | ||||
74 | __init_begin = .; | ||||
75 | |||||
76 | .init.text : { | ||||
77 | _sinittext = .; | ||||
78 | *(.init.text) | ||||
79 | _einittext = .; | ||||
80 | } | ||||
81 | |||||
82 | /* .exit.text is discarded at runtime, not link time, | ||||
83 | * to deal with references from __bug_table | ||||
84 | */ | ||||
85 | .exit.text : { *(.exit.text) } | ||||
86 | |||||
87 | .init.data : { | ||||
88 | *(.init.data); | ||||
89 | __vtop_table_begin = .; | ||||
90 | *(.vtop_fixup); | ||||
91 | __vtop_table_end = .; | ||||
92 | __ptov_table_begin = .; | ||||
93 | *(.ptov_fixup); | ||||
94 | __ptov_table_end = .; | ||||
Stephen Rothwell | c4e3ea2 | 2006-05-19 17:04:48 +1000 | [diff] [blame] | 95 | #ifdef CONFIG_PPC_ISERIES |
96 | __dt_strings_start = .; | ||||
97 | *(.dt_strings); | ||||
98 | __dt_strings_end = .; | ||||
99 | #endif | ||||
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 100 | } |
101 | |||||
102 | . = ALIGN(16); | ||||
103 | .init.setup : { | ||||
104 | __setup_start = .; | ||||
105 | *(.init.setup) | ||||
106 | __setup_end = .; | ||||
107 | } | ||||
108 | |||||
109 | .initcall.init : { | ||||
110 | __initcall_start = .; | ||||
111 | *(.initcall1.init) | ||||
112 | *(.initcall2.init) | ||||
113 | *(.initcall3.init) | ||||
114 | *(.initcall4.init) | ||||
115 | *(.initcall5.init) | ||||
116 | *(.initcall6.init) | ||||
117 | *(.initcall7.init) | ||||
118 | __initcall_end = .; | ||||
119 | } | ||||
120 | |||||
121 | .con_initcall.init : { | ||||
122 | __con_initcall_start = .; | ||||
123 | *(.con_initcall.init) | ||||
124 | __con_initcall_end = .; | ||||
125 | } | ||||
126 | |||||
127 | SECURITY_INIT | ||||
128 | |||||
129 | . = ALIGN(8); | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 130 | __ftr_fixup : { |
131 | __start___ftr_fixup = .; | ||||
132 | *(__ftr_fixup) | ||||
133 | __stop___ftr_fixup = .; | ||||
134 | } | ||||
Stephen Rothwell | 3f639ee | 2006-09-25 18:19:00 +1000 | [diff] [blame^] | 135 | #ifdef CONFIG_PPC64 |
136 | . = ALIGN(8); | ||||
137 | __fw_ftr_fixup : { | ||||
138 | __start___fw_ftr_fixup = .; | ||||
139 | *(__fw_ftr_fixup) | ||||
140 | __stop___fw_ftr_fixup = .; | ||||
141 | } | ||||
142 | #endif | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 143 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 144 | . = ALIGN(PAGE_SIZE); |
145 | .init.ramfs : { | ||||
146 | __initramfs_start = .; | ||||
147 | *(.init.ramfs) | ||||
148 | __initramfs_end = .; | ||||
149 | } | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 150 | |
151 | #ifdef CONFIG_PPC32 | ||||
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 152 | . = ALIGN(32); |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 153 | #else |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 154 | . = ALIGN(128); |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 155 | #endif |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 156 | .data.percpu : { |
157 | __per_cpu_start = .; | ||||
158 | *(.data.percpu) | ||||
159 | __per_cpu_end = .; | ||||
160 | } | ||||
161 | |||||
162 | . = ALIGN(8); | ||||
163 | .machine.desc : { | ||||
164 | __machine_desc_start = . ; | ||||
165 | *(.machine.desc) | ||||
166 | __machine_desc_end = . ; | ||||
167 | } | ||||
168 | |||||
169 | /* freed after init ends here */ | ||||
170 | . = ALIGN(PAGE_SIZE); | ||||
171 | __init_end = .; | ||||
172 | |||||
173 | /* | ||||
174 | * And now the various read/write data | ||||
175 | */ | ||||
176 | |||||
177 | . = ALIGN(PAGE_SIZE); | ||||
178 | _sdata = .; | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 179 | |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 180 | #ifdef CONFIG_PPC32 |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 181 | .data : |
182 | { | ||||
183 | *(.data) | ||||
184 | *(.sdata) | ||||
185 | *(.got.plt) *(.got) | ||||
186 | } | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 187 | #else |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 188 | .data : { |
189 | *(.data .data.rel* .toc1) | ||||
190 | *(.branch_lt) | ||||
191 | } | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 192 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 193 | .opd : { |
194 | *(.opd) | ||||
195 | } | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 196 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 197 | .got : { |
198 | __toc_start = .; | ||||
199 | *(.got) | ||||
200 | *(.toc) | ||||
201 | } | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 202 | #endif |
Paul Mackerras | 4a28856 | 2005-10-10 22:38:46 +1000 | [diff] [blame] | 203 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 204 | . = ALIGN(PAGE_SIZE); |
205 | _edata = .; | ||||
206 | PROVIDE32 (edata = .); | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 207 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 208 | /* The initial task and kernel stack */ |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 209 | #ifdef CONFIG_PPC32 |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 210 | . = ALIGN(8192); |
211 | #else | ||||
212 | . = ALIGN(16384); | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 213 | #endif |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 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 | . = ALIGN(PAGE_SIZE); | ||||
228 | __data_nosave : { | ||||
229 | __nosave_begin = .; | ||||
230 | *(.data.nosave) | ||||
231 | . = ALIGN(PAGE_SIZE); | ||||
232 | __nosave_end = .; | ||||
233 | } | ||||
234 | |||||
235 | /* | ||||
236 | * And finally the bss | ||||
237 | */ | ||||
238 | |||||
239 | .bss : { | ||||
240 | __bss_start = .; | ||||
241 | *(.sbss) *(.scommon) | ||||
242 | *(.dynbss) | ||||
243 | *(.bss) | ||||
244 | *(COMMON) | ||||
245 | __bss_stop = .; | ||||
246 | } | ||||
247 | |||||
248 | . = ALIGN(PAGE_SIZE); | ||||
249 | _end = . ; | ||||
250 | PROVIDE32 (end = .); | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 251 | } |