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> |
Tony Breeds | bd67fcf | 2007-07-04 14:04:31 +1000 | [diff] [blame] | 10 | #include <asm/cache.h> |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 11 | |
Michael Ellerman | e19e4ab | 2005-11-03 16:03:06 +1100 | [diff] [blame] | 12 | ENTRY(_stext) |
13 | |||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 14 | #ifdef CONFIG_PPC64 |
15 | OUTPUT_ARCH(powerpc:common64) | ||||
16 | jiffies = jiffies_64; | ||||
17 | #else | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 18 | OUTPUT_ARCH(powerpc:common) |
19 | jiffies = jiffies_64 + 4; | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 20 | #endif |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 21 | SECTIONS |
22 | { | ||||
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 23 | /* Sections to be discarded. */ |
24 | /DISCARD/ : { | ||||
25 | *(.exitcall.exit) | ||||
26 | *(.exit.data) | ||||
27 | } | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 28 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 29 | . = KERNELBASE; |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 30 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 31 | /* |
32 | * Text, read only data and other permanent read-only sections | ||||
33 | */ | ||||
34 | |||||
35 | /* Text and gots */ | ||||
36 | .text : { | ||||
Kumar Gala | 748a768 | 2007-09-13 15:42:35 -0500 | [diff] [blame^] | 37 | ALIGN_FUNCTION(); |
38 | *(.text.head) | ||||
Eric W. Biederman | fd593d1 | 2006-12-07 02:14:04 +0100 | [diff] [blame] | 39 | _text = .; |
Sam Ravnborg | 7664709 | 2007-05-13 00:31:33 +0200 | [diff] [blame] | 40 | TEXT_TEXT |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 41 | SCHED_TEXT |
42 | LOCK_TEXT | ||||
43 | KPROBES_TEXT | ||||
44 | *(.fixup) | ||||
45 | |||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 46 | #ifdef CONFIG_PPC32 |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 47 | *(.got1) |
48 | __got2_start = .; | ||||
49 | *(.got2) | ||||
50 | __got2_end = .; | ||||
51 | #endif /* CONFIG_PPC32 */ | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 52 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 53 | . = ALIGN(PAGE_SIZE); |
54 | _etext = .; | ||||
55 | PROVIDE32 (etext = .); | ||||
56 | } | ||||
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 | /* Read-only data */ |
59 | RODATA | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 60 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 61 | /* Exception & bug tables */ |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 62 | __ex_table : { |
63 | __start___ex_table = .; | ||||
64 | *(__ex_table) | ||||
65 | __stop___ex_table = .; | ||||
66 | } | ||||
67 | |||||
Roland McGrath | 8fb775e | 2007-07-19 01:48:38 -0700 | [diff] [blame] | 68 | NOTES |
69 | |||||
Jeremy Fitzhardinge | 73c9cea | 2006-12-08 03:30:41 -0800 | [diff] [blame] | 70 | BUG_TABLE |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 71 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 72 | /* |
73 | * Init sections discarded at runtime | ||||
74 | */ | ||||
75 | . = ALIGN(PAGE_SIZE); | ||||
76 | __init_begin = .; | ||||
77 | |||||
78 | .init.text : { | ||||
79 | _sinittext = .; | ||||
80 | *(.init.text) | ||||
81 | _einittext = .; | ||||
82 | } | ||||
83 | |||||
84 | /* .exit.text is discarded at runtime, not link time, | ||||
85 | * to deal with references from __bug_table | ||||
86 | */ | ||||
87 | .exit.text : { *(.exit.text) } | ||||
88 | |||||
89 | .init.data : { | ||||
90 | *(.init.data); | ||||
91 | __vtop_table_begin = .; | ||||
92 | *(.vtop_fixup); | ||||
93 | __vtop_table_end = .; | ||||
94 | __ptov_table_begin = .; | ||||
95 | *(.ptov_fixup); | ||||
96 | __ptov_table_end = .; | ||||
Stephen Rothwell | c4e3ea2 | 2006-05-19 17:04:48 +1000 | [diff] [blame] | 97 | #ifdef CONFIG_PPC_ISERIES |
98 | __dt_strings_start = .; | ||||
99 | *(.dt_strings); | ||||
100 | __dt_strings_end = .; | ||||
101 | #endif | ||||
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 102 | } |
103 | |||||
104 | . = ALIGN(16); | ||||
105 | .init.setup : { | ||||
106 | __setup_start = .; | ||||
107 | *(.init.setup) | ||||
108 | __setup_end = .; | ||||
109 | } | ||||
110 | |||||
111 | .initcall.init : { | ||||
112 | __initcall_start = .; | ||||
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 113 | INITCALLS |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 114 | __initcall_end = .; |
115 | } | ||||
116 | |||||
117 | .con_initcall.init : { | ||||
118 | __con_initcall_start = .; | ||||
119 | *(.con_initcall.init) | ||||
120 | __con_initcall_end = .; | ||||
121 | } | ||||
122 | |||||
123 | SECURITY_INIT | ||||
124 | |||||
125 | . = ALIGN(8); | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 126 | __ftr_fixup : { |
127 | __start___ftr_fixup = .; | ||||
128 | *(__ftr_fixup) | ||||
129 | __stop___ftr_fixup = .; | ||||
130 | } | ||||
Stephen Rothwell | 3f639ee | 2006-09-25 18:19:00 +1000 | [diff] [blame] | 131 | #ifdef CONFIG_PPC64 |
132 | . = ALIGN(8); | ||||
133 | __fw_ftr_fixup : { | ||||
134 | __start___fw_ftr_fixup = .; | ||||
135 | *(__fw_ftr_fixup) | ||||
136 | __stop___fw_ftr_fixup = .; | ||||
137 | } | ||||
138 | #endif | ||||
Jean-Paul Saman | 67d3822 | 2007-02-10 01:44:44 -0800 | [diff] [blame] | 139 | #ifdef CONFIG_BLK_DEV_INITRD |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 140 | . = ALIGN(PAGE_SIZE); |
141 | .init.ramfs : { | ||||
142 | __initramfs_start = .; | ||||
143 | *(.init.ramfs) | ||||
144 | __initramfs_end = .; | ||||
145 | } | ||||
Jean-Paul Saman | 67d3822 | 2007-02-10 01:44:44 -0800 | [diff] [blame] | 146 | #endif |
Jeremy Fitzhardinge | b6e3590 | 2007-05-02 19:27:12 +0200 | [diff] [blame] | 147 | . = ALIGN(PAGE_SIZE); |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 148 | .data.percpu : { |
149 | __per_cpu_start = .; | ||||
150 | *(.data.percpu) | ||||
Fenghua Yu | 5fb7dc3 | 2007-07-19 01:48:12 -0700 | [diff] [blame] | 151 | *(.data.percpu.shared_aligned) |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 152 | __per_cpu_end = .; |
153 | } | ||||
154 | |||||
155 | . = ALIGN(8); | ||||
156 | .machine.desc : { | ||||
157 | __machine_desc_start = . ; | ||||
158 | *(.machine.desc) | ||||
159 | __machine_desc_end = . ; | ||||
160 | } | ||||
161 | |||||
162 | /* freed after init ends here */ | ||||
163 | . = ALIGN(PAGE_SIZE); | ||||
164 | __init_end = .; | ||||
165 | |||||
166 | /* | ||||
167 | * And now the various read/write data | ||||
168 | */ | ||||
169 | |||||
170 | . = ALIGN(PAGE_SIZE); | ||||
171 | _sdata = .; | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 172 | |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 173 | #ifdef CONFIG_PPC32 |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 174 | .data : |
175 | { | ||||
Sam Ravnborg | ca96725 | 2007-05-17 13:38:44 +0200 | [diff] [blame] | 176 | DATA_DATA |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 177 | *(.sdata) |
178 | *(.got.plt) *(.got) | ||||
179 | } | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 180 | #else |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 181 | .data : { |
Mathieu Desnoyers | 3ae0aa9 | 2007-06-16 22:29:04 -0400 | [diff] [blame] | 182 | DATA_DATA |
183 | *(.data.rel*) | ||||
184 | *(.toc1) | ||||
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 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 | |||||
Tony Breeds | bd67fcf | 2007-07-04 14:04:31 +1000 | [diff] [blame] | 222 | . = ALIGN(L1_CACHE_BYTES); |
223 | .data.read_mostly : { | ||||
224 | *(.data.read_mostly) | ||||
225 | } | ||||
226 | |||||
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 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 | } |