diff options
Diffstat (limited to 'arch/x86/kernel/vmlinux_64.lds.S')
-rw-r--r-- | arch/x86/kernel/vmlinux_64.lds.S | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/arch/x86/kernel/vmlinux_64.lds.S b/arch/x86/kernel/vmlinux_64.lds.S index 1a614c0e6be..f50280db0df 100644 --- a/arch/x86/kernel/vmlinux_64.lds.S +++ b/arch/x86/kernel/vmlinux_64.lds.S | |||
@@ -19,6 +19,9 @@ PHDRS { | |||
19 | data PT_LOAD FLAGS(7); /* RWE */ | 19 | data PT_LOAD FLAGS(7); /* RWE */ |
20 | user PT_LOAD FLAGS(7); /* RWE */ | 20 | user PT_LOAD FLAGS(7); /* RWE */ |
21 | data.init PT_LOAD FLAGS(7); /* RWE */ | 21 | data.init PT_LOAD FLAGS(7); /* RWE */ |
22 | #ifdef CONFIG_SMP | ||
23 | percpu PT_LOAD FLAGS(7); /* RWE */ | ||
24 | #endif | ||
22 | note PT_NOTE FLAGS(0); /* ___ */ | 25 | note PT_NOTE FLAGS(0); /* ___ */ |
23 | } | 26 | } |
24 | SECTIONS | 27 | SECTIONS |
@@ -208,14 +211,26 @@ SECTIONS | |||
208 | __initramfs_end = .; | 211 | __initramfs_end = .; |
209 | #endif | 212 | #endif |
210 | 213 | ||
214 | #ifdef CONFIG_SMP | ||
215 | /* | ||
216 | * percpu offsets are zero-based on SMP. PERCPU_VADDR() changes the | ||
217 | * output PHDR, so the next output section - __data_nosave - should | ||
218 | * switch it back to data.init. | ||
219 | */ | ||
220 | . = ALIGN(PAGE_SIZE); | ||
221 | PERCPU_VADDR(0, :percpu) | ||
222 | #else | ||
211 | PERCPU(PAGE_SIZE) | 223 | PERCPU(PAGE_SIZE) |
224 | #endif | ||
212 | 225 | ||
213 | . = ALIGN(PAGE_SIZE); | 226 | . = ALIGN(PAGE_SIZE); |
214 | __init_end = .; | 227 | __init_end = .; |
215 | 228 | ||
216 | . = ALIGN(PAGE_SIZE); | 229 | . = ALIGN(PAGE_SIZE); |
217 | __nosave_begin = .; | 230 | __nosave_begin = .; |
218 | .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) { *(.data.nosave) } | 231 | .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) { |
232 | *(.data.nosave) | ||
233 | } :data.init /* switch back to data.init, see PERCPU_VADDR() above */ | ||
219 | . = ALIGN(PAGE_SIZE); | 234 | . = ALIGN(PAGE_SIZE); |
220 | __nosave_end = .; | 235 | __nosave_end = .; |
221 | 236 | ||