aboutsummaryrefslogtreecommitdiff
path: root/tools/objtool
diff options
context:
space:
mode:
authorGravatar Thomas Weißschuh <linux@weissschuh.net> 2022-12-27 16:00:57 +0000
committerGravatar Josh Poimboeuf <jpoimboe@kernel.org> 2023-02-01 09:15:22 -0800
commitd93ee0553cf2e83c1696a18423bcf05b94b85e1d (patch)
tree55cc519afba75c77a55dcd2bdfe9c6508e8ee5b6 /tools/objtool
parentobjtool: Fix HOSTCC flag usage (diff)
downloadlinux-d93ee0553cf2e83c1696a18423bcf05b94b85e1d.tar.gz
linux-d93ee0553cf2e83c1696a18423bcf05b94b85e1d.tar.bz2
linux-d93ee0553cf2e83c1696a18423bcf05b94b85e1d.zip
objtool: Make struct entries[] static and const
This data is not modified and not used outside of special.c. Also adapt its users to the constness. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20221216-objtool-memory-v2-1-17968f85a464@weissschuh.net Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Diffstat (limited to 'tools/objtool')
-rw-r--r--tools/objtool/special.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/objtool/special.c b/tools/objtool/special.c
index 9c8d827f69af..baa85c31526b 100644
--- a/tools/objtool/special.c
+++ b/tools/objtool/special.c
@@ -26,7 +26,7 @@ struct special_entry {
unsigned char key; /* jump_label key */
};
-struct special_entry entries[] = {
+static const struct special_entry entries[] = {
{
.sec = ".altinstructions",
.group = true,
@@ -65,7 +65,7 @@ static void reloc_to_sec_off(struct reloc *reloc, struct section **sec,
*off = reloc->sym->offset + reloc->addend;
}
-static int get_alt_entry(struct elf *elf, struct special_entry *entry,
+static int get_alt_entry(struct elf *elf, const struct special_entry *entry,
struct section *sec, int idx,
struct special_alt *alt)
{
@@ -139,7 +139,7 @@ static int get_alt_entry(struct elf *elf, struct special_entry *entry,
*/
int special_get_alts(struct elf *elf, struct list_head *alts)
{
- struct special_entry *entry;
+ const struct special_entry *entry;
struct section *sec;
unsigned int nr_entries;
struct special_alt *alt;