From 7ce2374673c74feb5086ac14d2aa5607632400a8 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Tue, 29 Jun 2004 05:15:45 -0700 Subject: [PATCH] x86_64 .init.setup alignment fix We're now putting 24-byte structures into .init.setup via __setup. But x86_64's compiler is emitting a `.align 16' in there, so they end up on 32-byte boundaries and do_early_param()'s pointer arithmetic goes wrong. Fix that up by forcing the compiler to align these structures to sizeof(long). Cc: Andi Kleen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/init.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/include/linux/init.h b/include/linux/init.h index 64d7417c835e..7a9f69992516 100644 --- a/include/linux/init.h +++ b/include/linux/init.h @@ -113,12 +113,18 @@ struct obs_kernel_param { int early; }; -/* Only for really core code. See moduleparam.h for the normal way. */ +/* + * Only for really core code. See moduleparam.h for the normal way. + * + * Force the alignment so the compiler doesn't space elements of the + * obs_kernel_param "array" too far apart in .init.setup. + */ #define __setup_param(str, unique_id, fn, early) \ static char __setup_str_##unique_id[] __initdata = str; \ static struct obs_kernel_param __setup_##unique_id \ - __attribute_used__ \ - __attribute__((__section__(".init.setup"))) \ + __attribute_used__ \ + __attribute__((__section__(".init.setup"))) \ + __attribute__((aligned((sizeof(long))))) \ = { __setup_str_##unique_id, fn, early } #define __setup_null_param(str, unique_id) \ -- cgit v1.2.3