From 219be963e9fc2d587508f839a21ede50068a191c Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Sat, 24 May 2025 19:17:24 +0100 Subject: [PATCH] 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 --- tools/kmod.c | 4 ++-- tools/static-nodes.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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, -- 2.47.3