mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-07 06:52:07 +00:00
objtool: Fix static_call list generation
Currently, objtool generates tail call entries in add_jump_destination() but waits until validate_branch() to generate the regular call entries. Move these to add_call_destination() for consistency. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Borislav Petkov <bp@suse.de> Signed-off-by: Ingo Molnar <mingo@kernel.org> Reviewed-by: Miroslav Benes <mbenes@suse.cz> Link: https://lkml.kernel.org/r/20210326151259.691529901@infradead.org
This commit is contained in:
parent
530b4ddd9d
commit
a958c4fea7
1 changed files with 12 additions and 5 deletions
|
@ -1045,6 +1045,11 @@ static int add_call_destinations(struct objtool_file *file)
|
||||||
} else
|
} else
|
||||||
insn->call_dest = reloc->sym;
|
insn->call_dest = reloc->sym;
|
||||||
|
|
||||||
|
if (insn->call_dest && insn->call_dest->static_call_tramp) {
|
||||||
|
list_add_tail(&insn->static_call_node,
|
||||||
|
&file->static_call_list);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Many compilers cannot disable KCOV with a function attribute
|
* Many compilers cannot disable KCOV with a function attribute
|
||||||
* so they need a little help, NOP out any KCOV calls from noinstr
|
* so they need a little help, NOP out any KCOV calls from noinstr
|
||||||
|
@ -1788,6 +1793,9 @@ static int decode_sections(struct objtool_file *file)
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Must be before add_{jump_call}_destination.
|
||||||
|
*/
|
||||||
ret = read_static_call_tramps(file);
|
ret = read_static_call_tramps(file);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1800,6 +1808,10 @@ static int decode_sections(struct objtool_file *file)
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Must be before add_call_destination(); it changes INSN_CALL to
|
||||||
|
* INSN_JUMP.
|
||||||
|
*/
|
||||||
ret = read_intra_function_calls(file);
|
ret = read_intra_function_calls(file);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -2762,11 +2774,6 @@ static int validate_branch(struct objtool_file *file, struct symbol *func,
|
||||||
if (dead_end_function(file, insn->call_dest))
|
if (dead_end_function(file, insn->call_dest))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (insn->type == INSN_CALL && insn->call_dest->static_call_tramp) {
|
|
||||||
list_add_tail(&insn->static_call_node,
|
|
||||||
&file->static_call_list);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case INSN_JUMP_CONDITIONAL:
|
case INSN_JUMP_CONDITIONAL:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue