Paul Mackerras | c51e3a4 | 2005-11-05 10:36:59 +1100 | [diff] [blame] | 1 | #ifdef CONFIG_PPC64 |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 2 | #define PROVIDE32(x) PROVIDE(__unused__##x) |
Paul Mackerras | c51e3a4 | 2005-11-05 10:36:59 +1100 | [diff] [blame] | 3 | #else |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 4 | #define PROVIDE32(x) PROVIDE(x) |
Paul Mackerras | c51e3a4 | 2005-11-05 10:36:59 +1100 | [diff] [blame] | 5 | #endif |
Kumar Gala | 4846c5d | 2008-04-16 05:52:26 +1000 | [diff] [blame^] | 6 | #include <asm/page.h> |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 7 | #include <asm-generic/vmlinux.lds.h> |
Tony Breeds | bd67fcf | 2007-07-04 14:04:31 +1000 | [diff] [blame] | 8 | #include <asm/cache.h> |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 9 | |
Michael Ellerman | e19e4ab | 2005-11-03 16:03:06 +1100 | [diff] [blame] | 10 | ENTRY(_stext) |
11 | |||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 12 | #ifdef CONFIG_PPC64 |
13 | OUTPUT_ARCH(powerpc:common64) | ||||
14 | jiffies = jiffies_64; | ||||
15 | #else | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 16 | OUTPUT_ARCH(powerpc:common) |
17 | jiffies = jiffies_64 + 4; | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 18 | #endif |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 19 | SECTIONS |
20 | { | ||||
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 21 | /* Sections to be discarded. */ |
22 | /DISCARD/ : { | ||||
23 | *(.exitcall.exit) | ||||
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 24 | EXIT_DATA |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 25 | } |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 26 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 27 | . = KERNELBASE; |
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 | /* |
30 | * Text, read only data and other permanent read-only sections | ||||
31 | */ | ||||
32 | |||||
33 | /* Text and gots */ | ||||
34 | .text : { | ||||
Kumar Gala | 748a768 | 2007-09-13 15:42:35 -0500 | [diff] [blame] | 35 | ALIGN_FUNCTION(); |
36 | *(.text.head) | ||||
Eric W. Biederman | fd593d1 | 2006-12-07 02:14:04 +0100 | [diff] [blame] | 37 | _text = .; |
Stephen Rothwell | e95c918 | 2007-11-04 13:28:39 +1100 | [diff] [blame] | 38 | *(.text .fixup .text.init.refok .exit.text.refok) |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 39 | SCHED_TEXT |
40 | LOCK_TEXT | ||||
41 | KPROBES_TEXT | ||||
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 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 | |||||
Roland McGrath | 8fb775e | 2007-07-19 01:48:38 -0700 | [diff] [blame] | 65 | NOTES |
66 | |||||
Jeremy Fitzhardinge | 73c9cea | 2006-12-08 03:30:41 -0800 | [diff] [blame] | 67 | BUG_TABLE |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 68 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 69 | /* |
70 | * Init sections discarded at runtime | ||||
71 | */ | ||||
72 | . = ALIGN(PAGE_SIZE); | ||||
73 | __init_begin = .; | ||||
74 | |||||
75 | .init.text : { | ||||
76 | _sinittext = .; | ||||
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 77 | INIT_TEXT |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 78 | _einittext = .; |
79 | } | ||||
80 | |||||
81 | /* .exit.text is discarded at runtime, not link time, | ||||
82 | * to deal with references from __bug_table | ||||
83 | */ | ||||
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 84 | .exit.text : { |
85 | EXIT_TEXT | ||||
86 | } | ||||
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 87 | |
88 | .init.data : { | ||||
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 89 | INIT_DATA |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 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 | ||||
Jean-Paul Saman | 67d3822 | 2007-02-10 01:44:44 -0800 | [diff] [blame] | 138 | #ifdef CONFIG_BLK_DEV_INITRD |
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 | } | ||||
Jean-Paul Saman | 67d3822 | 2007-02-10 01:44:44 -0800 | [diff] [blame] | 145 | #endif |
Jeremy Fitzhardinge | b6e3590 | 2007-05-02 19:27:12 +0200 | [diff] [blame] | 146 | . = ALIGN(PAGE_SIZE); |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 147 | .data.percpu : { |
148 | __per_cpu_start = .; | ||||
149 | *(.data.percpu) | ||||
Fenghua Yu | 5fb7dc3 | 2007-07-19 01:48:12 -0700 | [diff] [blame] | 150 | *(.data.percpu.shared_aligned) |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 151 | __per_cpu_end = .; |
152 | } | ||||
153 | |||||
154 | . = ALIGN(8); | ||||
155 | .machine.desc : { | ||||
156 | __machine_desc_start = . ; | ||||
157 | *(.machine.desc) | ||||
158 | __machine_desc_end = . ; | ||||
159 | } | ||||
160 | |||||
161 | /* freed after init ends here */ | ||||
162 | . = ALIGN(PAGE_SIZE); | ||||
163 | __init_end = .; | ||||
164 | |||||
165 | /* | ||||
166 | * And now the various read/write data | ||||
167 | */ | ||||
168 | |||||
169 | . = ALIGN(PAGE_SIZE); | ||||
170 | _sdata = .; | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 171 | |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 172 | #ifdef CONFIG_PPC32 |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 173 | .data : |
174 | { | ||||
Sam Ravnborg | ca96725 | 2007-05-17 13:38:44 +0200 | [diff] [blame] | 175 | DATA_DATA |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 176 | *(.sdata) |
177 | *(.got.plt) *(.got) | ||||
178 | } | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 179 | #else |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 180 | .data : { |
Mathieu Desnoyers | 3ae0aa9 | 2007-06-16 22:29:04 -0400 | [diff] [blame] | 181 | DATA_DATA |
182 | *(.data.rel*) | ||||
183 | *(.toc1) | ||||
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 184 | *(.branch_lt) |
185 | } | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 186 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 187 | .opd : { |
188 | *(.opd) | ||||
189 | } | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 190 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 191 | .got : { |
192 | __toc_start = .; | ||||
193 | *(.got) | ||||
194 | *(.toc) | ||||
195 | } | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 196 | #endif |
Paul Mackerras | 4a28856 | 2005-10-10 22:38:46 +1000 | [diff] [blame] | 197 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 198 | . = ALIGN(PAGE_SIZE); |
199 | _edata = .; | ||||
200 | PROVIDE32 (edata = .); | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 201 | |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 202 | /* The initial task and kernel stack */ |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 203 | #ifdef CONFIG_PPC32 |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 204 | . = ALIGN(8192); |
205 | #else | ||||
206 | . = ALIGN(16384); | ||||
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 207 | #endif |
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 208 | .data.init_task : { |
209 | *(.data.init_task) | ||||
210 | } | ||||
211 | |||||
212 | . = ALIGN(PAGE_SIZE); | ||||
213 | .data.page_aligned : { | ||||
214 | *(.data.page_aligned) | ||||
215 | } | ||||
216 | |||||
217 | .data.cacheline_aligned : { | ||||
218 | *(.data.cacheline_aligned) | ||||
219 | } | ||||
220 | |||||
Tony Breeds | bd67fcf | 2007-07-04 14:04:31 +1000 | [diff] [blame] | 221 | . = ALIGN(L1_CACHE_BYTES); |
222 | .data.read_mostly : { | ||||
223 | *(.data.read_mostly) | ||||
224 | } | ||||
225 | |||||
Benjamin Herrenschmidt | e822250 | 2006-03-28 23:15:54 +1100 | [diff] [blame] | 226 | . = ALIGN(PAGE_SIZE); |
227 | __data_nosave : { | ||||
228 | __nosave_begin = .; | ||||
229 | *(.data.nosave) | ||||
230 | . = ALIGN(PAGE_SIZE); | ||||
231 | __nosave_end = .; | ||||
232 | } | ||||
233 | |||||
234 | /* | ||||
235 | * And finally the bss | ||||
236 | */ | ||||
237 | |||||
238 | .bss : { | ||||
239 | __bss_start = .; | ||||
240 | *(.sbss) *(.scommon) | ||||
241 | *(.dynbss) | ||||
242 | *(.bss) | ||||
243 | *(COMMON) | ||||
244 | __bss_stop = .; | ||||
245 | } | ||||
246 | |||||
247 | . = ALIGN(PAGE_SIZE); | ||||
248 | _end = . ; | ||||
249 | PROVIDE32 (end = .); | ||||
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 250 | } |