summaryrefslogtreecommitdiff
path: root/include/linux/moduleparam.h
diff options
context:
space:
mode:
authorAndi Kleen <ak@colin.muc.de>2003-06-15 05:21:41 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2003-06-15 05:21:41 -0700
commit38d5b085d2a0d36ece55bcede84be9ae88cd4481 (patch)
treec0d913e4e87de2338fd11e427778ff50948b54f5 /include/linux/moduleparam.h
parentaae1760a589df2117879f0b36e098f271735f4b5 (diff)
[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.
Diffstat (limited to 'include/linux/moduleparam.h')
-rw-r--r--include/linux/moduleparam.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index e52553263640..62127f6f4ad9 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -40,7 +40,7 @@ struct kparam_string {
#define __module_param_call(prefix, name, set, get, arg, perm) \
static char __param_str_##name[] __initdata = prefix #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 }
#define module_param_call(name, set, get, arg, perm) \