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