summaryrefslogtreecommitdiffstats
path: root/tools/objtool/check.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2021-10-26 14:01:35 +0200
committerPeter Zijlstra <peterz@infradead.org>2021-10-28 23:25:25 +0200
commitc509331b41b7365e17396c246e8c5797bccc8074 (patch)
tree14127a365c021d27be11046391673f0089f6270c /tools/objtool/check.c
parentobjtool: Explicitly avoid self modifying code in .altinstr_replacement (diff)
downloadlinux-c509331b41b7365e17396c246e8c5797bccc8074.tar.xz
linux-c509331b41b7365e17396c246e8c5797bccc8074.zip
objtool: Shrink struct instruction
Any one instruction can only ever call a single function, therefore insn->mcount_loc_node is superfluous and can use insn->call_node. This shrinks struct instruction, which is by far the most numerous structure objtool creates. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Borislav Petkov <bp@suse.de> Acked-by: Josh Poimboeuf <jpoimboe@redhat.com> Tested-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/r/20211026120309.785456706@infradead.org
Diffstat (limited to 'tools/objtool/check.c')
-rw-r--r--tools/objtool/check.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 8ab6f24f8753..ce3c25fec2a6 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -701,7 +701,7 @@ static int create_mcount_loc_sections(struct objtool_file *file)
return 0;
idx = 0;
- list_for_each_entry(insn, &file->mcount_loc_list, mcount_loc_node)
+ list_for_each_entry(insn, &file->mcount_loc_list, call_node)
idx++;
sec = elf_create_section(file->elf, "__mcount_loc", 0, sizeof(unsigned long), idx);
@@ -709,7 +709,7 @@ static int create_mcount_loc_sections(struct objtool_file *file)
return -1;
idx = 0;
- list_for_each_entry(insn, &file->mcount_loc_list, mcount_loc_node) {
+ list_for_each_entry(insn, &file->mcount_loc_list, call_node) {
loc = (unsigned long *)sec->data->d_buf + idx;
memset(loc, 0, sizeof(unsigned long));
@@ -1051,7 +1051,7 @@ static void annotate_call_site(struct objtool_file *file,
insn->type = INSN_NOP;
- list_add_tail(&insn->mcount_loc_node, &file->mcount_loc_list);
+ list_add_tail(&insn->call_node, &file->mcount_loc_list);
return;
}
}