]> Git Repo - linux.git/commitdiff
modpost: use __section in the output to *.mod.c
authorMasahiro Yamada <[email protected]>
Mon, 9 Sep 2019 11:34:23 +0000 (20:34 +0900)
committerMasahiro Yamada <[email protected]>
Sat, 14 Sep 2019 02:40:13 +0000 (11:40 +0900)
Use the __section() shorthand. This avoids escaping double-quotes,
and improves the readability.

Signed-off-by: Masahiro Yamada <[email protected]>
scripts/mod/modpost.c

index 25036947bcb8903dc116d87379ff5354bb7e4400..820eed87fb43bf443a7e3ef801b384600c93793d 100644 (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)
This page took 0.056612 seconds and 4 git commands to generate.