]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - arch/powerpc/kernel/vmlinux.lds.S
kbuild: check section names consistently in modpost
[mirror_ubuntu-bionic-kernel.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 9#include <asm-generic/vmlinux.lds.h>
bd67fcf9 10#include <asm/cache.h>
14cf11af 11
e19e4ab4
ME
12ENTRY(_stext)
13
cabb5587
SR
14#ifdef CONFIG_PPC64
15OUTPUT_ARCH(powerpc:common64)
16jiffies = jiffies_64;
17#else
14cf11af
PM
18OUTPUT_ARCH(powerpc:common)
19jiffies = jiffies_64 + 4;
cabb5587 20#endif
14cf11af
PM
21SECTIONS
22{
e8222502
BH
23 /* Sections to be discarded. */
24 /DISCARD/ : {
25 *(.exitcall.exit)
26 *(.exit.data)
27 }
14cf11af 28
e8222502 29 . = KERNELBASE;
14cf11af 30
e8222502
BH
31/*
32 * Text, read only data and other permanent read-only sections
33 */
34
35 /* Text and gots */
36 .text : {
748a7683
KG
37 ALIGN_FUNCTION();
38 *(.text.head)
fd593d12 39 _text = .;
e95c9182 40 *(.text .fixup .text.init.refok .exit.text.refok)
e8222502
BH
41 SCHED_TEXT
42 LOCK_TEXT
43 KPROBES_TEXT
14cf11af 44
e8222502
BH
45#ifdef CONFIG_PPC32
46 *(.got1)
47 __got2_start = .;
48 *(.got2)
49 __got2_end = .;
50#endif /* CONFIG_PPC32 */
51
52 . = ALIGN(PAGE_SIZE);
53 _etext = .;
54 PROVIDE32 (etext = .);
55 }
56
57 /* Read-only data */
58 RODATA
59
60 /* Exception & bug tables */
14cf11af
PM
61 __ex_table : {
62 __start___ex_table = .;
63 *(__ex_table)
64 __stop___ex_table = .;
65 }
66
8fb775ee
RM
67 NOTES
68
73c9ceab 69 BUG_TABLE
14cf11af 70
e8222502
BH
71/*
72 * Init sections discarded at runtime
73 */
74 . = ALIGN(PAGE_SIZE);
75 __init_begin = .;
76
77 .init.text : {
78 _sinittext = .;
79 *(.init.text)
80 _einittext = .;
81 }
82
83 /* .exit.text is discarded at runtime, not link time,
84 * to deal with references from __bug_table
85 */
86 .exit.text : { *(.exit.text) }
87
88 .init.data : {
89 *(.init.data);
90 __vtop_table_begin = .;
91 *(.vtop_fixup);
92 __vtop_table_end = .;
93 __ptov_table_begin = .;
94 *(.ptov_fixup);
95 __ptov_table_end = .;
c4e3ea25
SR
96#ifdef CONFIG_PPC_ISERIES
97 __dt_strings_start = .;
98 *(.dt_strings);
99 __dt_strings_end = .;
100#endif
e8222502
BH
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 = .;
61ce1efe 112 INITCALLS
e8222502
BH
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);
cabb5587
SR
125 __ftr_fixup : {
126 __start___ftr_fixup = .;
127 *(__ftr_fixup)
128 __stop___ftr_fixup = .;
129 }
3f639ee8
SR
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
67d38229 138#ifdef CONFIG_BLK_DEV_INITRD
e8222502
BH
139 . = ALIGN(PAGE_SIZE);
140 .init.ramfs : {
141 __initramfs_start = .;
142 *(.init.ramfs)
143 __initramfs_end = .;
144 }
67d38229 145#endif
b6e3590f 146 . = ALIGN(PAGE_SIZE);
e8222502
BH
147 .data.percpu : {
148 __per_cpu_start = .;
149 *(.data.percpu)
5fb7dc37 150 *(.data.percpu.shared_aligned)
e8222502
BH
151 __per_cpu_end = .;
152 }
14cf11af 153
e8222502
BH
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 = .;
14cf11af 171
cabb5587 172#ifdef CONFIG_PPC32
e8222502
BH
173 .data :
174 {
ca967258 175 DATA_DATA
e8222502
BH
176 *(.sdata)
177 *(.got.plt) *(.got)
178 }
cabb5587 179#else
e8222502 180 .data : {
3ae0aa9f
MD
181 DATA_DATA
182 *(.data.rel*)
183 *(.toc1)
e8222502
BH
184 *(.branch_lt)
185 }
14cf11af 186
e8222502
BH
187 .opd : {
188 *(.opd)
189 }
190
191 .got : {
192 __toc_start = .;
193 *(.got)
194 *(.toc)
195 }
cabb5587 196#endif
14cf11af 197
e8222502
BH
198 . = ALIGN(PAGE_SIZE);
199 _edata = .;
200 PROVIDE32 (edata = .);
201
202 /* The initial task and kernel stack */
203#ifdef CONFIG_PPC32
204 . = ALIGN(8192);
cabb5587 205#else
e8222502
BH
206 . = ALIGN(16384);
207#endif
208 .data.init_task : {
209 *(.data.init_task)
210 }
14cf11af 211
e8222502
BH
212 . = ALIGN(PAGE_SIZE);
213 .data.page_aligned : {
214 *(.data.page_aligned)
215 }
14cf11af 216
e8222502
BH
217 .data.cacheline_aligned : {
218 *(.data.cacheline_aligned)
219 }
14cf11af 220
bd67fcf9
TB
221 . = ALIGN(L1_CACHE_BYTES);
222 .data.read_mostly : {
223 *(.data.read_mostly)
224 }
225
e8222502
BH
226 . = ALIGN(PAGE_SIZE);
227 __data_nosave : {
228 __nosave_begin = .;
229 *(.data.nosave)
230 . = ALIGN(PAGE_SIZE);
231 __nosave_end = .;
232 }
4a288563 233
e8222502
BH
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 }
14cf11af 246
e8222502
BH
247 . = ALIGN(PAGE_SIZE);
248 _end = . ;
249 PROVIDE32 (end = .);
14cf11af 250}