]> nv-tegra.nvidia Code Review - linux-2.6.git/commitdiff
x86, vmlinux.lds: unify percpu
authorSam Ravnborg <sam@ravnborg.org>
Wed, 29 Apr 2009 07:47:28 +0000 (09:47 +0200)
committerIngo Molnar <mingo@elte.hu>
Wed, 29 Apr 2009 08:20:34 +0000 (10:20 +0200)
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>
arch/x86/kernel/vmlinux.lds.S
arch/x86/kernel/vmlinux_32.lds.S
arch/x86/kernel/vmlinux_64.lds.S

index 1ab62a5fa1a53b0484702b665bf9a5352824f798..1ea2b8571e1a44f772a6cceb213864ec708dee26 100644 (file)
@@ -330,6 +330,36 @@ SECTIONS
        }
 #endif
 
+#if defined(CONFIG_X86_64) && defined(CONFIG_SMP)
+       /*
+        * percpu offsets are zero-based on SMP.  PERCPU_VADDR() changes the
+        * output PHDR, so the next output section - __data_nosave - should
+        * start another section data.init2.  Also, pda should be at the head of
+        * percpu area.  Preallocate it and define the percpu offset symbol
+        * so that it can be accessed as a percpu variable.
+        */
+       . = ALIGN(PAGE_SIZE);
+       PERCPU_VADDR(0, :percpu)
+#else
+       PERCPU(PAGE_SIZE)
+#endif
+
+       . = ALIGN(PAGE_SIZE);
+       /* freed after init ends here */
+       __init_end = .;
+
+#ifdef CONFIG_X86_64
+       .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
+               . = ALIGN(PAGE_SIZE);
+               __nosave_begin = .;
+               *(.data.nosave)
+               . = ALIGN(PAGE_SIZE);
+               __nosave_end = .;
+       } :data.init2
+       /* use another section data.init2, see PERCPU_VADDR() above */
+#endif
+
+
 #ifdef CONFIG_X86_32
 # include "vmlinux_32.lds.S"
 #else
index 36c8fbd3c762385f36517ef2f3c6a22bab581645..d23ee2c15c28d5d7af92aa752e021abe0b10e630 100644 (file)
@@ -1,11 +1,5 @@
-       PERCPU(PAGE_SIZE)
-
-       . = ALIGN(PAGE_SIZE);
-       /* freed after init ends here */
-
        /* BSS */
        .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
-               __init_end = .;
                __bss_start = .;
                *(.bss.page_aligned)
                *(.bss)
index 1aa536223330b98210600ec1fa96ec0c9919cfea..a53936696a0826c48577c916bbb08e13ba7fd0a5 100644 (file)
@@ -1,29 +1,3 @@
-#ifdef CONFIG_SMP
-       /*
-        * percpu offsets are zero-based on SMP.  PERCPU_VADDR() changes the
-        * output PHDR, so the next output section - __data_nosave - should
-        * start another section data.init2.  Also, pda should be at the head of
-        * percpu area.  Preallocate it and define the percpu offset symbol
-        * so that it can be accessed as a percpu variable.
-        */
-       . = ALIGN(PAGE_SIZE);
-       PERCPU_VADDR(0, :percpu)
-#else
-       PERCPU(PAGE_SIZE)
-#endif
-
-       . = ALIGN(PAGE_SIZE);
-       __init_end = .;
-
-       .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
-               . = ALIGN(PAGE_SIZE);
-               __nosave_begin = .;
-               *(.data.nosave)
-               . = ALIGN(PAGE_SIZE);
-               __nosave_end = .;
-       } :data.init2
-       /* use another section data.init2, see PERCPU_VADDR() above */
-
        .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
                . = ALIGN(PAGE_SIZE);
                __bss_start = .;                /* BSS */