From: Emil Velikov Date: Sat, 24 May 2025 18:17:24 +0000 (+0100) Subject: tools: move a few more symbols to data.rel.ro X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=219be963e9fc2d587508f839a21ede50068a191c;p=thirdparty%2Fkmod.git tools: move a few more symbols to data.rel.ro Annotate the arrays (not the data) as constant, so the compiler can store it in the RO segment. Signed-off-by: Emil Velikov Link: https://github.com/kmod-project/kmod/pull/358 Signed-off-by: Lucas De Marchi --- diff --git a/tools/kmod.c b/tools/kmod.c index 6a9c996b..75be2315 100644 --- a/tools/kmod.c +++ b/tools/kmod.c @@ -25,13 +25,13 @@ static const struct option options[] = { static const struct kmod_cmd kmod_cmd_help; -static const struct kmod_cmd *kmod_cmds[] = { +static const struct kmod_cmd *const kmod_cmds[] = { &kmod_cmd_help, &kmod_cmd_list, &kmod_cmd_static_nodes, }; -static const struct kmod_cmd *kmod_compat_cmds[] = { +static const struct kmod_cmd *const kmod_compat_cmds[] = { // clang-format off &kmod_cmd_compat_lsmod, &kmod_cmd_compat_rmmod, diff --git a/tools/static-nodes.c b/tools/static-nodes.c index 49bcfb9b..2957b466 100644 --- a/tools/static-nodes.c +++ b/tools/static-nodes.c @@ -33,7 +33,7 @@ static const struct static_nodes_format static_nodes_format_human; static const struct static_nodes_format static_nodes_format_tmpfiles; static const struct static_nodes_format static_nodes_format_devname; -static const struct static_nodes_format *static_nodes_formats[] = { +static const struct static_nodes_format *const static_nodes_formats[] = { &static_nodes_format_human, &static_nodes_format_tmpfiles, &static_nodes_format_devname,