1
0
Fork 0

modpost: use __section in the output to *.mod.c

Use the __section() shorthand. This avoids escaping double-quotes,
and improves the readability.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
alistair/sunxi64-5.4-dsi
Masahiro Yamada 2019-09-09 20:34:23 +09:00
parent 6df7e1ec93
commit a3d0cb04f7
1 changed files with 2 additions and 3 deletions

View File

@ -2176,7 +2176,7 @@ static void add_header(struct buffer *b, struct module *mod)
buf_printf(b, "MODULE_INFO(name, KBUILD_MODNAME);\n");
buf_printf(b, "\n");
buf_printf(b, "__visible struct module __this_module\n");
buf_printf(b, "__attribute__((section(\".gnu.linkonce.this_module\"))) = {\n");
buf_printf(b, "__section(.gnu.linkonce.this_module) = {\n");
buf_printf(b, "\t.name = KBUILD_MODNAME,\n");
if (mod->has_init)
buf_printf(b, "\t.init = init_module,\n");
@ -2230,8 +2230,7 @@ static int add_versions(struct buffer *b, struct module *mod)
buf_printf(b, "\n");
buf_printf(b, "static const struct modversion_info ____versions[]\n");
buf_printf(b, "__used\n");
buf_printf(b, "__attribute__((section(\"__versions\"))) = {\n");
buf_printf(b, "__used __section(__versions) = {\n");
for (s = mod->unres; s; s = s->next) {
if (!s->module)