diff options
| author | Peter Zijlstra <peterz@infradead.org> | 2021-10-26 14:01:35 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-07-23 12:53:50 +0200 |
| commit | cad0e43a8c302f12dc2c1c2f78b2303b942ceb37 (patch) | |
| tree | ce8331f466c91d6de5ae591b1e030d3118d9784f /tools/objtool | |
| parent | c9fd00d8e622a681cf0e39b0844e4da85364d6c4 (diff) | |
| download | linux-cad0e43a8c302f12dc2c1c2f78b2303b942ceb37.tar.gz linux-cad0e43a8c302f12dc2c1c2f78b2303b942ceb37.tar.bz2 linux-cad0e43a8c302f12dc2c1c2f78b2303b942ceb37.zip | |
objtool: Shrink struct instruction
commit c509331b41b7365e17396c246e8c5797bccc8074 upstream.
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
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/objtool')
| -rw-r--r-- | tools/objtool/check.c | 6 | ||||
| -rw-r--r-- | tools/objtool/include/objtool/check.h | 1 |
2 files changed, 3 insertions, 4 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c index dcceffe89751..49291f88b087 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -551,7 +551,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); @@ -559,7 +559,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)); @@ -909,7 +909,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; } } diff --git a/tools/objtool/include/objtool/check.h b/tools/objtool/include/objtool/check.h index 56d50bc50c10..fe8cf60ea69f 100644 --- a/tools/objtool/include/objtool/check.h +++ b/tools/objtool/include/objtool/check.h @@ -40,7 +40,6 @@ struct instruction { struct list_head list; struct hlist_node hash; struct list_head call_node; - struct list_head mcount_loc_node; struct section *sec; unsigned long offset; unsigned int len; |
