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) | ||||
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame^] | 26 | EXIT_DATA |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 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 = .; |
Stephen Rothwell | e95c918 | 2007-11-04 13:28:39 +1100 | [diff] [blame] | 40 | *(.text .fixup .text.init.refok .exit.text.refok) |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 41 | SCHED_TEXT |
42 | LOCK_TEXT | ||||
43 | KPROBES_TEXT | ||||
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 44 | |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 45 | #ifdef CONFIG_PPC32 |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 46 | *(.got1) |
47 | __got2_start = .; | ||||
48 | *(.got2) | ||||
49 | __got2_end = .; | ||||
50 | #endif /* CONFIG_PPC32 */ | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 51 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 52 | . = ALIGN(PAGE_SIZE); |
53 | _etext = .; | ||||
54 | PROVIDE32 (etext = .); | ||||
55 | } | ||||
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 | /* Read-only data */ |
58 | RODATA | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 59 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 60 | /* Exception & bug tables */ |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 61 | __ex_table : { |
62 | __start___ex_table = .; | ||||
63 | *(__ex_table) | ||||
64 | __stop___ex_table = .; | ||||
65 | } | ||||
66 | |||||
Roland McGrath | 8fb775e | 2007-07-19 01:48:38 -0700 | [diff] [blame] | 67 | NOTES |
68 | |||||
Jeremy Fitzhardinge | 73c9cea | 2006-12-08 03:30:41 -0800 | [diff] [blame] | 69 | BUG_TABLE |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 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 = .; | ||||
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame^] | 79 | INIT_TEXT |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 80 | _einittext = .; |
81 | } | ||||
82 | |||||
83 | /* .exit.text is discarded at runtime, not link time, | ||||
84 | * to deal with references from __bug_table | ||||
85 | */ | ||||
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame^] | 86 | .exit.text : { |
87 | EXIT_TEXT | ||||
88 | } | ||||
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 89 | |
90 | .init.data : { | ||||
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame^] | 91 | INIT_DATA |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 92 | __vtop_table_begin = .; |
93 | *(.vtop_fixup); | ||||
94 | __vtop_table_end = .; | ||||
95 | __ptov_table_begin = .; | ||||
96 | *(.ptov_fixup); | ||||
97 | __ptov_table_end = .; | ||||
Stephen Rothwell | c4e3ea2 | 2006-05-19 17:04:48 +1000 | [diff] [blame] | 98 | #ifdef CONFIG_PPC_ISERIES |
99 | __dt_strings_start = .; | ||||
100 | *(.dt_strings); | ||||
101 | __dt_strings_end = .; | ||||
102 | #endif | ||||
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 103 | } |
104 | |||||
105 | . = ALIGN(16); | ||||
106 | .init.setup : { | ||||
107 | __setup_start = .; | ||||
108 | *(.init.setup) | ||||
109 | __setup_end = .; | ||||
110 | } | ||||
111 | |||||
112 | .initcall.init : { | ||||
113 | __initcall_start = .; | ||||
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 114 | INITCALLS |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 115 | __initcall_end = .; |
116 | } | ||||
117 | |||||
118 | .con_initcall.init : { | ||||
119 | __con_initcall_start = .; | ||||
120 | *(.con_initcall.init) | ||||
121 | __con_initcall_end = .; | ||||
122 | } | ||||
123 | |||||
124 | SECURITY_INIT | ||||
125 | |||||
126 | . = ALIGN(8); | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 127 | __ftr_fixup : { |
128 | __start___ftr_fixup = .; | ||||
129 | *(__ftr_fixup) | ||||
130 | __stop___ftr_fixup = .; | ||||
131 | } | ||||
Stephen Rothwell | 3f639ee | 2006-09-25 18:19:00 +1000 | [diff] [blame] | 132 | #ifdef CONFIG_PPC64 |
133 | . = ALIGN(8); | ||||
134 | __fw_ftr_fixup : { | ||||
135 | __start___fw_ftr_fixup = .; | ||||
136 | *(__fw_ftr_fixup) | ||||
137 | __stop___fw_ftr_fixup = .; | ||||
138 | } | ||||
139 | #endif | ||||
Jean-Paul Saman | 67d3822 | 2007-02-10 01:44:44 -0800 | [diff] [blame] | 140 | #ifdef CONFIG_BLK_DEV_INITRD |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 141 | . = ALIGN(PAGE_SIZE); |
142 | .init.ramfs : { | ||||
143 | __initramfs_start = .; | ||||
144 | *(.init.ramfs) | ||||
145 | __initramfs_end = .; | ||||
146 | } | ||||
Jean-Paul Saman | 67d3822 | 2007-02-10 01:44:44 -0800 | [diff] [blame] | 147 | #endif |
Jeremy Fitzhardinge | b6e3590 | 2007-05-02 19:27:12 +0200 | [diff] [blame] | 148 | . = ALIGN(PAGE_SIZE); |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 149 | .data.percpu : { |
150 | __per_cpu_start = .; | ||||
151 | *(.data.percpu) | ||||
Fenghua Yu | 5fb7dc3 | 2007-07-19 01:48:12 -0700 | [diff] [blame] | 152 | *(.data.percpu.shared_aligned) |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 153 | __per_cpu_end = .; |
154 | } | ||||
155 | |||||
156 | . = ALIGN(8); | ||||
157 | .machine.desc : { | ||||
158 | __machine_desc_start = . ; | ||||
159 | *(.machine.desc) | ||||
160 | __machine_desc_end = . ; | ||||
161 | } | ||||
162 | |||||
163 | /* freed after init ends here */ | ||||
164 | . = ALIGN(PAGE_SIZE); | ||||
165 | __init_end = .; | ||||
166 | |||||
167 | /* | ||||
168 | * And now the various read/write data | ||||
169 | */ | ||||
170 | |||||
171 | . = ALIGN(PAGE_SIZE); | ||||
172 | _sdata = .; | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 173 | |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 174 | #ifdef CONFIG_PPC32 |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 175 | .data : |
176 | { | ||||
Sam Ravnborg | ca96725 | 2007-05-17 13:38:44 +0200 | [diff] [blame] | 177 | DATA_DATA |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 178 | *(.sdata) |
179 | *(.got.plt) *(.got) | ||||
180 | } | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 181 | #else |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 182 | .data : { |
Mathieu Desnoyers | 3ae0aa9 | 2007-06-16 22:29:04 -0400 | [diff] [blame] | 183 | DATA_DATA |
184 | *(.data.rel*) | ||||
185 | *(.toc1) | ||||
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 186 | *(.branch_lt) |
187 | } | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 188 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 189 | .opd : { |
190 | *(.opd) | ||||
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 | .got : { |
194 | __toc_start = .; | ||||
195 | *(.got) | ||||
196 | *(.toc) | ||||
197 | } | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 198 | #endif |
Paul Mackerras | 4a28856 | 2005-10-10 22:38:46 +1000 | [diff] [blame] | 199 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 200 | . = ALIGN(PAGE_SIZE); |
201 | _edata = .; | ||||
202 | PROVIDE32 (edata = .); | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 203 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 204 | /* The initial task and kernel stack */ |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 205 | #ifdef CONFIG_PPC32 |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 206 | . = ALIGN(8192); |
207 | #else | ||||
208 | . = ALIGN(16384); | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 209 | #endif |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 210 | .data.init_task : { |
211 | *(.data.init_task) | ||||
212 | } | ||||
213 | |||||
214 | . = ALIGN(PAGE_SIZE); | ||||
215 | .data.page_aligned : { | ||||
216 | *(.data.page_aligned) | ||||
217 | } | ||||
218 | |||||
219 | .data.cacheline_aligned : { | ||||
220 | *(.data.cacheline_aligned) | ||||
221 | } | ||||
222 | |||||
Tony Breeds | bd67fcf | 2007-07-04 14:04:31 +1000 | [diff] [blame] | 223 | . = ALIGN(L1_CACHE_BYTES); |
224 | .data.read_mostly : { | ||||
225 | *(.data.read_mostly) | ||||
226 | } | ||||
227 | |||||
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 228 | . = ALIGN(PAGE_SIZE); |
229 | __data_nosave : { | ||||
230 | __nosave_begin = .; | ||||
231 | *(.data.nosave) | ||||
232 | . = ALIGN(PAGE_SIZE); | ||||
233 | __nosave_end = .; | ||||
234 | } | ||||
235 | |||||
236 | /* | ||||
237 | * And finally the bss | ||||
238 | */ | ||||
239 | |||||
240 | .bss : { | ||||
241 | __bss_start = .; | ||||
242 | *(.sbss) *(.scommon) | ||||
243 | *(.dynbss) | ||||
244 | *(.bss) | ||||
245 | *(COMMON) | ||||
246 | __bss_stop = .; | ||||
247 | } | ||||
248 | |||||
249 | . = ALIGN(PAGE_SIZE); | ||||
250 | _end = . ; | ||||
251 | PROVIDE32 (end = .); | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 252 | } |