aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2009-04-29 03:47:28 -0400
committerIngo Molnar <mingo@elte.hu>2009-04-29 04:20:34 -0400
commit9d16e78318f174fd4b07916a93e41749d5199267 (patch)
treeca6c0cdbd651aeef4df3b0d6c2b9c05c0e8cbebd
parentbf6a57418d5445c98047edbec022c9e54d1526e6 (diff)
x86, vmlinux.lds: unify percpu
32 bit: - move __init_end outside the .bss output section It really did not belong in there [ Impact: 64-bit: cleanup, 32-bit: refactor linker script ] Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: Tim Abbott <tabbott@MIT.EDU> Cc: Linus Torvalds <torvalds@linux-foundation.org> LKML-Reference: <1240991249-27117-12-git-send-email-sam@ravnborg.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/kernel/vmlinux.lds.S30
-rw-r--r--arch/x86/kernel/vmlinux_32.lds.S6
-rw-r--r--arch/x86/kernel/vmlinux_64.lds.S26
3 files changed, 30 insertions, 32 deletions
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index 1ab62a5fa1a5..1ea2b8571e1a 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -330,6 +330,36 @@ SECTIONS
330 } 330 }
331#endif 331#endif
332 332
333#if defined(CONFIG_X86_64) && defined(CONFIG_SMP)
334 /*
335 * percpu offsets are zero-based on SMP. PERCPU_VADDR() changes the
336 * output PHDR, so the next output section - __data_nosave - should
337 * start another section data.init2. Also, pda should be at the head of
338 * percpu area. Preallocate it and define the percpu offset symbol
339 * so that it can be accessed as a percpu variable.
340 */
341 . = ALIGN(PAGE_SIZE);
342 PERCPU_VADDR(0, :percpu)
343#else
344 PERCPU(PAGE_SIZE)
345#endif
346
347 . = ALIGN(PAGE_SIZE);
348 /* freed after init ends here */
349 __init_end = .;
350
351#ifdef CONFIG_X86_64
352 .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
353 . = ALIGN(PAGE_SIZE);
354 __nosave_begin = .;
355 *(.data.nosave)
356 . = ALIGN(PAGE_SIZE);
357 __nosave_end = .;
358 } :data.init2
359 /* use another section data.init2, see PERCPU_VADDR() above */
360#endif
361
362
333#ifdef CONFIG_X86_32 363#ifdef CONFIG_X86_32
334# include "vmlinux_32.lds.S" 364# include "vmlinux_32.lds.S"
335#else 365#else
diff --git a/arch/x86/kernel/vmlinux_32.lds.S b/arch/x86/kernel/vmlinux_32.lds.S
index 36c8fbd3c762..d23ee2c15c28 100644
--- a/arch/x86/kernel/vmlinux_32.lds.S
+++ b/arch/x86/kernel/vmlinux_32.lds.S
@@ -1,11 +1,5 @@
1 PERCPU(PAGE_SIZE)
2
3 . = ALIGN(PAGE_SIZE);
4 /* freed after init ends here */
5
6 /* BSS */ 1 /* BSS */
7 .bss : AT(ADDR(.bss) - LOAD_OFFSET) { 2 .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
8 __init_end = .;
9 __bss_start = .; 3 __bss_start = .;
10 *(.bss.page_aligned) 4 *(.bss.page_aligned)
11 *(.bss) 5 *(.bss)
diff --git a/arch/x86/kernel/vmlinux_64.lds.S b/arch/x86/kernel/vmlinux_64.lds.S
index 1aa536223330..a53936696a08 100644
--- a/arch/x86/kernel/vmlinux_64.lds.S
+++ b/arch/x86/kernel/vmlinux_64.lds.S
@@ -1,29 +1,3 @@
1#ifdef CONFIG_SMP
2 /*
3 * percpu offsets are zero-based on SMP. PERCPU_VADDR() changes the
4 * output PHDR, so the next output section - __data_nosave - should
5 * start another section data.init2. Also, pda should be at the head of
6 * percpu area. Preallocate it and define the percpu offset symbol
7 * so that it can be accessed as a percpu variable.
8 */
9 . = ALIGN(PAGE_SIZE);
10 PERCPU_VADDR(0, :percpu)
11#else
12 PERCPU(PAGE_SIZE)
13#endif
14
15 . = ALIGN(PAGE_SIZE);
16 __init_end = .;
17
18 .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
19 . = ALIGN(PAGE_SIZE);
20 __nosave_begin = .;
21 *(.data.nosave)
22 . = ALIGN(PAGE_SIZE);
23 __nosave_end = .;
24 } :data.init2
25 /* use another section data.init2, see PERCPU_VADDR() above */
26
27 .bss : AT(ADDR(.bss) - LOAD_OFFSET) { 1 .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
28 . = ALIGN(PAGE_SIZE); 2 . = ALIGN(PAGE_SIZE);
29 __bss_start = .; /* BSS */ 3 __bss_start = .; /* BSS */