all-archs: consolidate .text section definition in asm-generic
[linux-block.git] / arch / powerpc / kernel / vmlinux.lds.S
CommitLineData
c51e3a41 1#ifdef CONFIG_PPC64
cabb5587 2#include <asm/page.h>
e8222502 3#define PROVIDE32(x) PROVIDE(__unused__##x)
c51e3a41
PM
4#else
5#define PAGE_SIZE 4096
6#define KERNELBASE CONFIG_KERNEL_START
e8222502 7#define PROVIDE32(x) PROVIDE(x)
c51e3a41 8#endif
14cf11af
PM
9#include <asm-generic/vmlinux.lds.h>
10
e19e4ab4
ME
11ENTRY(_stext)
12
cabb5587
SR
13#ifdef CONFIG_PPC64
14OUTPUT_ARCH(powerpc:common64)
15jiffies = jiffies_64;
16#else
14cf11af
PM
17OUTPUT_ARCH(powerpc:common)
18jiffies = jiffies_64 + 4;
cabb5587 19#endif
14cf11af
PM
20SECTIONS
21{
e8222502
BH
22 /* Sections to be discarded. */
23 /DISCARD/ : {
24 *(.exitcall.exit)
25 *(.exit.data)
26 }
14cf11af 27
e8222502 28 . = KERNELBASE;
14cf11af 29
e8222502
BH
30/*
31 * Text, read only data and other permanent read-only sections
32 */
33
34 /* Text and gots */
35 .text : {
fd593d12 36 _text = .;
7664709b
SR
37 *(.text.*)
38 TEXT_TEXT
e8222502
BH
39 SCHED_TEXT
40 LOCK_TEXT
41 KPROBES_TEXT
42 *(.fixup)
14cf11af 43
e8222502
BH
44#ifdef CONFIG_PPC32
45 *(.got1)
46 __got2_start = .;
47 *(.got2)
48 __got2_end = .;
49#endif /* CONFIG_PPC32 */
50
51 . = ALIGN(PAGE_SIZE);
52 _etext = .;
53 PROVIDE32 (etext = .);
54 }
55
56 /* Read-only data */
57 RODATA
58
59 /* Exception & bug tables */
14cf11af
PM
60 __ex_table : {
61 __start___ex_table = .;
62 *(__ex_table)
63 __stop___ex_table = .;
64 }
65
73c9ceab 66 BUG_TABLE
14cf11af 67
e8222502
BH
68/*
69 * Init sections discarded at runtime
70 */
71 . = ALIGN(PAGE_SIZE);
72 __init_begin = .;
73
74 .init.text : {
75 _sinittext = .;
76 *(.init.text)
77 _einittext = .;
78 }
79
80 /* .exit.text is discarded at runtime, not link time,
81 * to deal with references from __bug_table
82 */
83 .exit.text : { *(.exit.text) }
84
85 .init.data : {
86 *(.init.data);
87 __vtop_table_begin = .;
88 *(.vtop_fixup);
89 __vtop_table_end = .;
90 __ptov_table_begin = .;
91 *(.ptov_fixup);
92 __ptov_table_end = .;
c4e3ea25
SR
93#ifdef CONFIG_PPC_ISERIES
94 __dt_strings_start = .;
95 *(.dt_strings);
96 __dt_strings_end = .;
97#endif
e8222502
BH
98 }
99
100 . = ALIGN(16);
101 .init.setup : {
102 __setup_start = .;
103 *(.init.setup)
104 __setup_end = .;
105 }
106
107 .initcall.init : {
108 __initcall_start = .;
61ce1efe 109 INITCALLS
e8222502
BH
110 __initcall_end = .;
111 }
112
113 .con_initcall.init : {
114 __con_initcall_start = .;
115 *(.con_initcall.init)
116 __con_initcall_end = .;
117 }
118
119 SECURITY_INIT
120
121 . = ALIGN(8);
cabb5587
SR
122 __ftr_fixup : {
123 __start___ftr_fixup = .;
124 *(__ftr_fixup)
125 __stop___ftr_fixup = .;
126 }
3f639ee8
SR
127#ifdef CONFIG_PPC64
128 . = ALIGN(8);
129 __fw_ftr_fixup : {
130 __start___fw_ftr_fixup = .;
131 *(__fw_ftr_fixup)
132 __stop___fw_ftr_fixup = .;
133 }
134#endif
67d38229 135#ifdef CONFIG_BLK_DEV_INITRD
e8222502
BH
136 . = ALIGN(PAGE_SIZE);
137 .init.ramfs : {
138 __initramfs_start = .;
139 *(.init.ramfs)
140 __initramfs_end = .;
141 }
67d38229 142#endif
b6e3590f 143 . = ALIGN(PAGE_SIZE);
e8222502
BH
144 .data.percpu : {
145 __per_cpu_start = .;
146 *(.data.percpu)
147 __per_cpu_end = .;
148 }
14cf11af 149
e8222502
BH
150 . = ALIGN(8);
151 .machine.desc : {
152 __machine_desc_start = . ;
153 *(.machine.desc)
154 __machine_desc_end = . ;
155 }
156
157 /* freed after init ends here */
158 . = ALIGN(PAGE_SIZE);
159 __init_end = .;
160
161/*
162 * And now the various read/write data
163 */
164
165 . = ALIGN(PAGE_SIZE);
166 _sdata = .;
14cf11af 167
cabb5587 168#ifdef CONFIG_PPC32
e8222502
BH
169 .data :
170 {
171 *(.data)
172 *(.sdata)
173 *(.got.plt) *(.got)
174 }
cabb5587 175#else
e8222502
BH
176 .data : {
177 *(.data .data.rel* .toc1)
178 *(.branch_lt)
179 }
14cf11af 180
e8222502
BH
181 .opd : {
182 *(.opd)
183 }
184
185 .got : {
186 __toc_start = .;
187 *(.got)
188 *(.toc)
189 }
cabb5587 190#endif
14cf11af 191
e8222502
BH
192 . = ALIGN(PAGE_SIZE);
193 _edata = .;
194 PROVIDE32 (edata = .);
195
196 /* The initial task and kernel stack */
197#ifdef CONFIG_PPC32
198 . = ALIGN(8192);
cabb5587 199#else
e8222502
BH
200 . = ALIGN(16384);
201#endif
202 .data.init_task : {
203 *(.data.init_task)
204 }
14cf11af 205
e8222502
BH
206 . = ALIGN(PAGE_SIZE);
207 .data.page_aligned : {
208 *(.data.page_aligned)
209 }
14cf11af 210
e8222502
BH
211 .data.cacheline_aligned : {
212 *(.data.cacheline_aligned)
213 }
14cf11af 214
e8222502
BH
215 . = ALIGN(PAGE_SIZE);
216 __data_nosave : {
217 __nosave_begin = .;
218 *(.data.nosave)
219 . = ALIGN(PAGE_SIZE);
220 __nosave_end = .;
221 }
4a288563 222
e8222502
BH
223/*
224 * And finally the bss
225 */
226
227 .bss : {
228 __bss_start = .;
229 *(.sbss) *(.scommon)
230 *(.dynbss)
231 *(.bss)
232 *(COMMON)
233 __bss_stop = .;
234 }
14cf11af 235
e8222502
BH
236 . = ALIGN(PAGE_SIZE);
237 _end = . ;
238 PROVIDE32 (end = .);
14cf11af 239}