提交 0801a007 编写于 作者: J Johan Hovold 提交者: Jessica Yu

module: drop version-attribute alignment

Commit 98562ad8 ("module: explicitly align module_version_attribute
structure") added an alignment attribute to the struct
module_version_attribute type in order to fix an alignment issue on m68k
where the structure is 2-byte aligned while MODULE_VERSION() forced the
__modver section entries to be 4-byte aligned (sizeof(void *)).

This was essentially an alternative fix to the problem addressed by
b4bc8428 ("module: deal with alignment issues in built-in module
versions") which used the array-of-pointer trick to prevent gcc from
increasing alignment of the version attribute entries. And with the
pointer indirection in place there's no need to increase the alignment
of the type.

Link: https://lore.kernel.org/lkml/20201103175711.10731-1-johan@kernel.orgSigned-off-by: NJohan Hovold <johan@kernel.org>
Signed-off-by: NJessica Yu <jeyu@kernel.org>
上级 24b9f0d2
...@@ -66,7 +66,7 @@ struct module_version_attribute { ...@@ -66,7 +66,7 @@ struct module_version_attribute {
struct module_attribute mattr; struct module_attribute mattr;
const char *module_name; const char *module_name;
const char *version; const char *version;
} __attribute__ ((__aligned__(sizeof(void *)))); };
extern ssize_t __modver_version_show(struct module_attribute *, extern ssize_t __modver_version_show(struct module_attribute *,
struct module_kobject *, char *); struct module_kobject *, char *);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册