Commit 38d5b085 authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] Fix over-alignment problem on x86-64

Thanks to Jan Hubicka who suggested this fix.

The problem seems to be that gcc generates a 32byte alignment for static
objects > 32bytes.  This causes gas to set a high alignment on the
section, which causes the uneven (not multiple of sizeof(struct
kernel_param)) section size.  The pointer division with a base not being
a multiple of sizeof(*ptr) then causes the invalid result.

This just forces a small alignment, which makes the section end come out
with the correct alignment.

The only mystery left is why ld chose a 16 byte padding instead of
32byte.
parent aae1760a
...@@ -40,7 +40,7 @@ struct kparam_string { ...@@ -40,7 +40,7 @@ struct kparam_string {
#define __module_param_call(prefix, name, set, get, arg, perm) \ #define __module_param_call(prefix, name, set, get, arg, perm) \
static char __param_str_##name[] __initdata = prefix #name; \ static char __param_str_##name[] __initdata = prefix #name; \
static struct kernel_param const __param_##name \ static struct kernel_param const __param_##name \
__attribute__ ((unused,__section__ ("__param"))) \ __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \
= { __param_str_##name, perm, set, get, arg } = { __param_str_##name, perm, set, get, arg }
#define module_param_call(name, set, get, arg, perm) \ #define module_param_call(name, set, get, arg, perm) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment