[PATCH] i386: Convert PDA into the percpu section
[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
30 PHDRS {
31 text PT_LOAD FLAGS(5); /* R_E */
32 data PT_LOAD FLAGS(7); /* RWE */
33 note PT_NOTE FLAGS(4); /* R__ */
34 }
35 SECTIONS
36 {
37 . = LOAD_OFFSET + LOAD_PHYSICAL_ADDR;
38 phys_startup_32 = startup_32 - LOAD_OFFSET;
39
40 .text.head : AT(ADDR(.text.head) - LOAD_OFFSET) {
41 _text = .; /* Text and read-only data */
42 *(.text.head)
43 } :text = 0x9090
44
45 /* read-only */
46 .text : AT(ADDR(.text) - LOAD_OFFSET) {
47 *(.text)
48 SCHED_TEXT
49 LOCK_TEXT
50 KPROBES_TEXT
51 *(.fixup)
52 *(.gnu.warning)
53 _etext = .; /* End of text section */
54 } :text = 0x9090
55
56 . = ALIGN(16); /* Exception table */
57 __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
58 __start___ex_table = .;
59 *(__ex_table)
60 __stop___ex_table = .;
61 }
62
63 BUG_TABLE
64
65 . = ALIGN(4);
66 .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) {
67 __tracedata_start = .;
68 *(.tracedata)
69 __tracedata_end = .;
70 }
71
72 RODATA
73
74 /* writeable */
75 . = ALIGN(4096);
76 .data : AT(ADDR(.data) - LOAD_OFFSET) { /* Data */
77 *(.data)
78 CONSTRUCTORS
79 } :data
80
81 .paravirtprobe : AT(ADDR(.paravirtprobe) - LOAD_OFFSET) {
82 __start_paravirtprobe = .;
83 *(.paravirtprobe)
84 __stop_paravirtprobe = .;
85 }
86
87 . = ALIGN(4096);
88 .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
89 __nosave_begin = .;
90 *(.data.nosave)
91 . = ALIGN(4096);
92 __nosave_end = .;
93 }
94
95 . = ALIGN(4096);
96 .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
97 *(.data.idt)
98 }
99
100 . = ALIGN(32);
101 .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
102 *(.data.cacheline_aligned)
103 }
104
105 /* rarely changed data like cpu maps */
106 . = ALIGN(32);
107 .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {
108 *(.data.read_mostly)
109 _edata = .; /* End of data section */
110 }
111
112 . = ALIGN(THREAD_SIZE); /* init_task */
113 .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
114 *(.data.init_task)
115 }
116
117 /* might get freed after init */
118 . = ALIGN(4096);
119 .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
120 __smp_locks = .;
121 *(.smp_locks)
122 __smp_locks_end = .;
123 }
124 /* will be freed after init
125 * Following ALIGN() is required to make sure no other data falls on the
126 * same page where __smp_alt_end is pointing as that page might be freed
127 * after boot. Always make sure that ALIGN() directive is present after
128 * the section which contains __smp_alt_end.
129 */
130 . = ALIGN(4096);
131
132 /* will be freed after init */
133 . = ALIGN(4096); /* Init code and data */
134 .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
135 __init_begin = .;
136 _sinittext = .;
137 *(.init.text)
138 _einittext = .;
139 }
140 .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) { *(.init.data) }
141 . = ALIGN(16);
142 .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
143 __setup_start = .;
144 *(.init.setup)
145 __setup_end = .;
146 }
147 .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
148 __initcall_start = .;
149 INITCALLS
150 __initcall_end = .;
151 }
152 .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
153 __con_initcall_start = .;
154 *(.con_initcall.init)
155 __con_initcall_end = .;
156 }
157 SECURITY_INIT
158 . = ALIGN(4);
159 .altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) {
160 __alt_instructions = .;
161 *(.altinstructions)
162 __alt_instructions_end = .;
163 }
164 .altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) {
165 *(.altinstr_replacement)
166 }
167 . = ALIGN(4);
168 .parainstructions : AT(ADDR(.parainstructions) - LOAD_OFFSET) {
169 __start_parainstructions = .;
170 *(.parainstructions)
171 __stop_parainstructions = .;
172 }
173 /* .exit.text is discard at runtime, not link time, to deal with references
174 from .altinstructions and .eh_frame */
175 .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { *(.exit.text) }
176 .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) { *(.exit.data) }
177 #if defined(CONFIG_BLK_DEV_INITRD)
178 . = ALIGN(4096);
179 .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
180 __initramfs_start = .;
181 *(.init.ramfs)
182 __initramfs_end = .;
183 }
184 #endif
185 . = ALIGN(4096);
186 .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) {
187 __per_cpu_start = .;
188 *(.data.percpu)
189 __per_cpu_end = .;
190 }
191 . = ALIGN(4096);
192 /* freed after init ends here */
193
194 .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
195 __init_end = .;
196 __bss_start = .; /* BSS */
197 *(.bss.page_aligned)
198 *(.bss)
199 . = ALIGN(4);
200 __bss_stop = .;
201 _end = . ;
202 /* This is where the kernel creates the early boot page tables */
203 . = ALIGN(4096);
204 pg0 = . ;
205 }
206
207 /* Sections to be discarded */
208 /DISCARD/ : {
209 *(.exitcall.exit)
210 }
211
212 STABS_DEBUG
213
214 DWARF_DEBUG
215
216 NOTES
217 }
This page took 0.039202 seconds and 5 git commands to generate.