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