Commit 87cf61fe authored by Alexandre Chartre's avatar Alexandre Chartre Committed by Peter Zijlstra
Browse files

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: default avatarAlexandre Chartre <alexandre.chartre@oracle.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: default avatarMiroslav Benes <mbenes@suse.cz>
Acked-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
Link: https://lkml.kernel.org/r/20200414103618.12657-2-alexandre.chartre@oracle.com
parent 1ff865e3
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1484,7 +1484,7 @@ static int decode_sections(struct objtool_file *file)


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