Skip to content

Commit a3d0cb0

Browse files
committed
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>
1 parent 6df7e1e commit a3d0cb0

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎scripts/mod/modpost.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2176,7 +2176,7 @@ static void add_header(struct buffer *b, struct module *mod)
21762176
buf_printf(b, "MODULE_INFO(name, KBUILD_MODNAME);\n");
21772177
buf_printf(b, "\n");
21782178
buf_printf(b, "__visible struct module __this_module\n");
2179-
buf_printf(b, "__attribute__((section(\".gnu.linkonce.this_module\"))) = {\n");
2179+
buf_printf(b, "__section(.gnu.linkonce.this_module) = {\n");
21802180
buf_printf(b, "\t.name = KBUILD_MODNAME,\n");
21812181
if (mod->has_init)
21822182
buf_printf(b, "\t.init = init_module,\n");
@@ -2230,8 +2230,7 @@ static int add_versions(struct buffer *b, struct module *mod)
22302230

22312231
buf_printf(b, "\n");
22322232
buf_printf(b, "static const struct modversion_info ____versions[]\n");
2233-
buf_printf(b, "__used\n");
2234-
buf_printf(b, "__attribute__((section(\"__versions\"))) = {\n");
2233+
buf_printf(b, "__used __section(__versions) = {\n");
22352234

22362235
for (s = mod->unres; s; s = s->next) {
22372236
if (!s->module)

0 commit comments

Comments
 (0)