From 4096b46f01a362fe2cc83f6be25cc7be6bce2ab7 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Tue, 29 May 2007 21:29:00 +0200 Subject: 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 --- include/asm-generic/vmlinux.lds.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'include/asm-generic') 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) { \ -- cgit v1.1