Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4096b46f01a362fe2cc83f6be25cc7be6bce2ab7
Commit:     4096b46f01a362fe2cc83f6be25cc7be6bce2ab7
Parent:     c420bc9f09a0926b708c3edb27eacba434a4f4ba
Author:     Sam Ravnborg <[EMAIL PROTECTED]>
AuthorDate: Tue May 29 21:29:00 2007 +0200
Committer:  Sam Ravnborg <[EMAIL PROTECTED]>
CommitDate: Tue May 29 21:29:00 2007 +0200

    sparc64: fix alignment bug in linker definition script
    
    The RO_DATA section were hardcoded to a specific
    alignment in include/asm-generic/vmlinux.h.
    But for sparc64 this did not match the PAGE_SIZE.
    
    Introduce a new section definition named:
    RO_DATA that takes actual alignment as parameter.
    RODATA are provided for backward compatibility.
    
    On top of this avoid hardcoding alignment for
    sparc64 in reset of the script
    Fix is build-tested on sparc64 + x86_64.
    
    Signed-off-by: Sam Ravnborg <[EMAIL PROTECTED]>
---
 arch/sparc64/kernel/vmlinux.lds.S |   11 ++++++-----
 include/asm-generic/vmlinux.lds.h |   10 +++++++---
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/arch/sparc64/kernel/vmlinux.lds.S 
b/arch/sparc64/kernel/vmlinux.lds.S
index fb648de..3ad10f3 100644
--- a/arch/sparc64/kernel/vmlinux.lds.S
+++ b/arch/sparc64/kernel/vmlinux.lds.S
@@ -1,5 +1,6 @@
 /* ld script to make UltraLinux kernel */
 
+#include <asm/page.h>
 #include <asm-generic/vmlinux.lds.h>
 
 OUTPUT_FORMAT("elf64-sparc", "elf64-sparc", "elf64-sparc")
@@ -23,7 +24,7 @@ SECTIONS
   _etext = .;
   PROVIDE (etext = .);
 
-  RODATA
+  RO_DATA(PAGE_SIZE)
 
   .data    :
   {
@@ -44,7 +45,7 @@ SECTIONS
   __ex_table : { *(__ex_table) }
   __stop___ex_table = .;
 
-  . = ALIGN(8192);
+  . = ALIGN(PAGE_SIZE);
   __init_begin = .;
   .init.text : { 
        _sinittext = .;
@@ -83,17 +84,17 @@ SECTIONS
   __sun4v_2insn_patch_end = .;
 
 #ifdef CONFIG_BLK_DEV_INITRD
-  . = ALIGN(8192); 
+  . = ALIGN(PAGE_SIZE);
   __initramfs_start = .;
   .init.ramfs : { *(.init.ramfs) }
   __initramfs_end = .;
 #endif
 
-  . = ALIGN(8192);
+  . = ALIGN(PAGE_SIZE);
   __per_cpu_start = .;
   .data.percpu  : { *(.data.percpu) }
   __per_cpu_end = .;
-  . = ALIGN(8192);
+  . = ALIGN(PAGE_SIZE);
   __init_end = .;
   __bss_start = .;
   .sbss      : { *(.sbss) *(.scommon) }
diff --git a/include/asm-generic/vmlinux.lds.h 
b/include/asm-generic/vmlinux.lds.h
index 8307b1b..84155eb 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -14,8 +14,8 @@
        *(.data)                                                        \
        *(.data.init.refok)
 
-#define RODATA                                                         \
-       . = ALIGN(4096);                                                \
+#define RO_DATA(align)                                                 \
+       . = ALIGN((align));                                             \
        .rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {           \
                VMLINUX_SYMBOL(__start_rodata) = .;                     \
                *(.rodata) *(.rodata.*)                                 \
@@ -135,7 +135,11 @@
                VMLINUX_SYMBOL(__end_rodata) = .;                       \
        }                                                               \
                                                                        \
-       . = ALIGN(4096);
+       . = ALIGN((align));
+
+/* RODATA provided for backward compatibility.
+ * All archs are supposed to use RO_DATA() */
+#define RODATA RO_DATA(4096)
 
 #define SECURITY_INIT                                                  \
        .security_initcall.init : AT(ADDR(.security_initcall.init) - 
LOAD_OFFSET) { \
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to