Skip to content

Commit 87cf61f

Browse files
achartrePeter Zijlstra
authored andcommitted
objtool: is_fentry_call() crashes if call has no destination
Fix is_fentry_call() so that it works if a call has no destination set (call_dest). This needs to be done in order to support intra- function calls. Signed-off-by: Alexandre Chartre <alexandre.chartre@oracle.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Miroslav Benes <mbenes@suse.cz> Acked-by: Josh Poimboeuf <jpoimboe@redhat.com> Link: https://lkml.kernel.org/r/20200414103618.12657-2-alexandre.chartre@oracle.com
1 parent 1ff865e commit 87cf61f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎tools/objtool/check.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1484,7 +1484,7 @@ static int decode_sections(struct objtool_file *file)
14841484

14851485
static bool is_fentry_call(struct instruction *insn)
14861486
{
1487-
if (insn->type == INSN_CALL &&
1487+
if (insn->type == INSN_CALL && insn->call_dest &&
14881488
insn->call_dest->type == STT_NOTYPE &&
14891489
!strcmp(insn->call_dest->name, "__fentry__"))
14901490
return true;

0 commit comments

Comments
 (0)