Paul Mackerras | c51e3a4 | 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 | c51e3a4 | 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 | c51e3a4 | 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 : { | ||||
Eric W. Biederman | fd593d1 | 2006-12-07 02:14:04 +0100 | [diff] [blame^] | 36 | _text = .; |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 37 | *(.text .text.*) |
38 | SCHED_TEXT | ||||
39 | LOCK_TEXT | ||||
40 | KPROBES_TEXT | ||||
41 | *(.fixup) | ||||
42 | |||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 43 | #ifdef CONFIG_PPC32 |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 44 | *(.got1) |
45 | __got2_start = .; | ||||
46 | *(.got2) | ||||
47 | __got2_end = .; | ||||
48 | #endif /* CONFIG_PPC32 */ | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 49 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 50 | . = ALIGN(PAGE_SIZE); |
51 | _etext = .; | ||||
52 | PROVIDE32 (etext = .); | ||||
53 | } | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 54 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 55 | /* Read-only data */ |
56 | RODATA | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 57 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 58 | /* Exception & bug tables */ |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 59 | __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 Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 71 | /* |
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 Rothwell | c4e3ea2 | 2006-05-19 17:04:48 +1000 | [diff] [blame] | 96 | #ifdef CONFIG_PPC_ISERIES |
97 | __dt_strings_start = .; | ||||
98 | *(.dt_strings); | ||||
99 | __dt_strings_end = .; | ||||
100 | #endif | ||||
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 101 | } |
102 | |||||
103 | . = ALIGN(16); | ||||
104 | .init.setup : { | ||||
105 | __setup_start = .; | ||||
106 | *(.init.setup) | ||||
107 | __setup_end = .; | ||||
108 | } | ||||
109 | |||||
110 | .initcall.init : { | ||||
111 | __initcall_start = .; | ||||
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 112 | INITCALLS |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 113 | __initcall_end = .; |
114 | } | ||||
115 | |||||
116 | .con_initcall.init : { | ||||
117 | __con_initcall_start = .; | ||||
118 | *(.con_initcall.init) | ||||
119 | __con_initcall_end = .; | ||||
120 | } | ||||
121 | |||||
122 | SECURITY_INIT | ||||
123 | |||||
124 | . = ALIGN(8); | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 125 | __ftr_fixup : { |
126 | __start___ftr_fixup = .; | ||||
127 | *(__ftr_fixup) | ||||
128 | __stop___ftr_fixup = .; | ||||
129 | } | ||||
Stephen Rothwell | 3f639ee | 2006-09-25 18:19:00 +1000 | [diff] [blame] | 130 | #ifdef CONFIG_PPC64 |
131 | . = ALIGN(8); | ||||
132 | __fw_ftr_fixup : { | ||||
133 | __start___fw_ftr_fixup = .; | ||||
134 | *(__fw_ftr_fixup) | ||||
135 | __stop___fw_ftr_fixup = .; | ||||
136 | } | ||||
137 | #endif | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 138 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 139 | . = ALIGN(PAGE_SIZE); |
140 | .init.ramfs : { | ||||
141 | __initramfs_start = .; | ||||
142 | *(.init.ramfs) | ||||
143 | __initramfs_end = .; | ||||
144 | } | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 145 | |
146 | #ifdef CONFIG_PPC32 | ||||
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 147 | . = ALIGN(32); |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 148 | #else |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 149 | . = ALIGN(128); |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 150 | #endif |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 151 | .data.percpu : { |
152 | __per_cpu_start = .; | ||||
153 | *(.data.percpu) | ||||
154 | __per_cpu_end = .; | ||||
155 | } | ||||
156 | |||||
157 | . = ALIGN(8); | ||||
158 | .machine.desc : { | ||||
159 | __machine_desc_start = . ; | ||||
160 | *(.machine.desc) | ||||
161 | __machine_desc_end = . ; | ||||
162 | } | ||||
163 | |||||
164 | /* freed after init ends here */ | ||||
165 | . = ALIGN(PAGE_SIZE); | ||||
166 | __init_end = .; | ||||
167 | |||||
168 | /* | ||||
169 | * And now the various read/write data | ||||
170 | */ | ||||
171 | |||||
172 | . = ALIGN(PAGE_SIZE); | ||||
173 | _sdata = .; | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 174 | |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 175 | #ifdef CONFIG_PPC32 |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 176 | .data : |
177 | { | ||||
178 | *(.data) | ||||
179 | *(.sdata) | ||||
180 | *(.got.plt) *(.got) | ||||
181 | } | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 182 | #else |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 183 | .data : { |
184 | *(.data .data.rel* .toc1) | ||||
185 | *(.branch_lt) | ||||
186 | } | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 187 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 188 | .opd : { |
189 | *(.opd) | ||||
190 | } | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 191 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 192 | .got : { |
193 | __toc_start = .; | ||||
194 | *(.got) | ||||
195 | *(.toc) | ||||
196 | } | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 197 | #endif |
Paul Mackerras | 4a28856 | 2005-10-10 22:38:46 +1000 | [diff] [blame] | 198 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 199 | . = ALIGN(PAGE_SIZE); |
200 | _edata = .; | ||||
201 | PROVIDE32 (edata = .); | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 202 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 203 | /* The initial task and kernel stack */ |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 204 | #ifdef CONFIG_PPC32 |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 205 | . = ALIGN(8192); |
206 | #else | ||||
207 | . = ALIGN(16384); | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 208 | #endif |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 209 | .data.init_task : { |
210 | *(.data.init_task) | ||||
211 | } | ||||
212 | |||||
213 | . = ALIGN(PAGE_SIZE); | ||||
214 | .data.page_aligned : { | ||||
215 | *(.data.page_aligned) | ||||
216 | } | ||||
217 | |||||
218 | .data.cacheline_aligned : { | ||||
219 | *(.data.cacheline_aligned) | ||||
220 | } | ||||
221 | |||||
222 | . = ALIGN(PAGE_SIZE); | ||||
223 | __data_nosave : { | ||||
224 | __nosave_begin = .; | ||||
225 | *(.data.nosave) | ||||
226 | . = ALIGN(PAGE_SIZE); | ||||
227 | __nosave_end = .; | ||||
228 | } | ||||
229 | |||||
230 | /* | ||||
231 | * And finally the bss | ||||
232 | */ | ||||
233 | |||||
234 | .bss : { | ||||
235 | __bss_start = .; | ||||
236 | *(.sbss) *(.scommon) | ||||
237 | *(.dynbss) | ||||
238 | *(.bss) | ||||
239 | *(COMMON) | ||||
240 | __bss_stop = .; | ||||
241 | } | ||||
242 | |||||
243 | . = ALIGN(PAGE_SIZE); | ||||
244 | _end = . ; | ||||
245 | PROVIDE32 (end = .); | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 246 | } |