diff options
| author | Andrew Morton <akpm@osdl.org> | 2004-06-29 05:15:45 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-06-29 05:15:45 -0700 |
| commit | 7ce2374673c74feb5086ac14d2aa5607632400a8 (patch) | |
| tree | 7978c75a20a4f2740837d160374f07c6d648d0b2 | |
| parent | 4bba626e66930b683d619f15337bc5896178f22e (diff) | |
[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 <ak@muc.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
| -rw-r--r-- | include/linux/init.h | 12 |
1 files 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) \ |
