[PATCH] x86: Allow percpu variables to be page-aligned
[deliverable/linux.git] / arch / i386 / kernel / vmlinux.lds.S
1 /* ld script to make i386 Linux kernel
2 * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>;
3 *
4 * Don't define absolute symbols until and unless you know that symbol
5 * value is should remain constant even if kernel image is relocated
6 * at run time. Absolute symbols are not relocated. If symbol value should
7 * change if kernel is relocated, make the symbol section relative and
8 * put it inside the section definition.
9 */
10
11 /* Don't define absolute symbols until and unless you know that symbol
12 * value is should remain constant even if kernel image is relocated
13 * at run time. Absolute symbols are not relocated. If symbol value should
14 * change if kernel is relocated, make the symbol section relative and
15 * put it inside the section definition.
16 */
17 #define LOAD_OFFSET __PAGE_OFFSET
18
19 #include <asm-generic/vmlinux.lds.h>
20 #include <asm/thread_info.h>
21 #include <asm/page.h>
22 #include <asm/cache.h>
23 #include <asm/boot.h>
24
25 OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
26 OUTPUT_ARCH(i386)
27 ENTRY(phys_startup_32)
28 jiffies = jiffies_64;
29 _proxy_pda = 1;
30
31 PHDRS {
32 text PT_LOAD FLAGS(5); /* R_E */
33 data PT_LOAD FLAGS(7); /* RWE */
34 note PT_NOTE FLAGS(4); /* R__ */
35 }
36 SECTIONS
37 {
38 . = LOAD_OFFSET + LOAD_PHYSICAL_ADDR;
39 phys_startup_32 = startup_32 - LOAD_OFFSET;
40
41 .text.head : AT(ADDR(.text.head) - LOAD_OFFSET) {
42 _text = .; /* Text and read-only data */
43 *(.text.head)
44 } :text = 0x9090
45
46 /* read-only */
47 .text : AT(ADDR(.text) - LOAD_OFFSET) {
48 *(.text)
49 SCHED_TEXT
50 LOCK_TEXT
51 KPROBES_TEXT
52 *(.fixup)
53 *(.gnu.warning)
54 _etext = .; /* End of text section */
55 } :text = 0x9090
56
57 . = ALIGN(16); /* Exception table */
58 __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
59 __start___ex_table = .;
60 *(__ex_table)
61 __stop___ex_table = .;
62 }
63
64 BUG_TABLE
65
66 . = ALIGN(4);
67 .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) {
68 __tracedata_start = .;
69 *(.tracedata)
70 __tracedata_end = .;
71 }
72
73 RODATA
74
75 /* writeable */
76 . = ALIGN(4096);
77 .data : AT(ADDR(.data) - LOAD_OFFSET) { /* Data */
78 *(.data)
79 CONSTRUCTORS
80 } :data
81
82 .paravirtprobe : AT(ADDR(.paravirtprobe) - LOAD_OFFSET) {
83 __start_paravirtprobe = .;
84 *(.paravirtprobe)
85 __stop_paravirtprobe = .;
86 }
87
88 . = ALIGN(4096);
89 .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
90 __nosave_begin = .;
91 *(.data.nosave)
92 . = ALIGN(4096);
93 __nosave_end = .;
94 }
95
96 . = ALIGN(4096);
97 .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
98 *(.data.idt)
99 }
100
101 . = ALIGN(32);
102 .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
103 *(.data.cacheline_aligned)
104 }
105
106 /* rarely changed data like cpu maps */
107 . = ALIGN(32);
108 .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {
109 *(.data.read_mostly)
110 _edata = .; /* End of data section */
111 }
112
113 . = ALIGN(THREAD_SIZE); /* init_task */
114 .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
115 *(.data.init_task)
116 }
117
118 /* might get freed after init */
119 . = ALIGN(4096);
120 .smp_altinstructions : AT(ADDR(.smp_altinstructions) - LOAD_OFFSET) {
121 __smp_alt_begin = .;
122 __smp_alt_instructions = .;
123 *(.smp_altinstructions)
124 __smp_alt_instructions_end = .;
125 }
126 . = ALIGN(4);
127 .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
128 __smp_locks = .;
129 *(.smp_locks)
130 __smp_locks_end = .;
131 }
132 .smp_altinstr_replacement : AT(ADDR(.smp_altinstr_replacement) - LOAD_OFFSET) {
133 *(.smp_altinstr_replacement)
134 __smp_alt_end = .;
135 }
136 /* will be freed after init
137 * Following ALIGN() is required to make sure no other data falls on the
138 * same page where __smp_alt_end is pointing as that page might be freed
139 * after boot. Always make sure that ALIGN() directive is present after
140 * the section which contains __smp_alt_end.
141 */
142 . = ALIGN(4096);
143
144 /* will be freed after init */
145 . = ALIGN(4096); /* Init code and data */
146 .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
147 __init_begin = .;
148 _sinittext = .;
149 *(.init.text)
150 _einittext = .;
151 }
152 .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) { *(.init.data) }
153 . = ALIGN(16);
154 .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
155 __setup_start = .;
156 *(.init.setup)
157 __setup_end = .;
158 }
159 .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
160 __initcall_start = .;
161 INITCALLS
162 __initcall_end = .;
163 }
164 .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
165 __con_initcall_start = .;
166 *(.con_initcall.init)
167 __con_initcall_end = .;
168 }
169 SECURITY_INIT
170 . = ALIGN(4);
171 .altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) {
172 __alt_instructions = .;
173 *(.altinstructions)
174 __alt_instructions_end = .;
175 }
176 .altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) {
177 *(.altinstr_replacement)
178 }
179 . = ALIGN(4);
180 .parainstructions : AT(ADDR(.parainstructions) - LOAD_OFFSET) {
181 __start_parainstructions = .;
182 *(.parainstructions)
183 __stop_parainstructions = .;
184 }
185 /* .exit.text is discard at runtime, not link time, to deal with references
186 from .altinstructions and .eh_frame */
187 .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { *(.exit.text) }
188 .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) { *(.exit.data) }
189 #if defined(CONFIG_BLK_DEV_INITRD)
190 . = ALIGN(4096);
191 .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
192 __initramfs_start = .;
193 *(.init.ramfs)
194 __initramfs_end = .;
195 }
196 #endif
197 . = ALIGN(4096);
198 .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) {
199 __per_cpu_start = .;
200 *(.data.percpu)
201 __per_cpu_end = .;
202 }
203 . = ALIGN(4096);
204 /* freed after init ends here */
205
206 .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
207 __init_end = .;
208 __bss_start = .; /* BSS */
209 *(.bss.page_aligned)
210 *(.bss)
211 . = ALIGN(4);
212 __bss_stop = .;
213 _end = . ;
214 /* This is where the kernel creates the early boot page tables */
215 . = ALIGN(4096);
216 pg0 = . ;
217 }
218
219 /* Sections to be discarded */
220 /DISCARD/ : {
221 *(.exitcall.exit)
222 }
223
224 STABS_DEBUG
225
226 DWARF_DEBUG
227
228 NOTES
229 }
This page took 0.046167 seconds and 5 git commands to generate.