summaryrefslogtreecommitdiffstats
path: root/tools/objtool/check.c
diff options
context:
space:
mode:
authorAlexandre Chartre <alexandre.chartre@oracle.com>2020-04-14 12:36:10 +0200
committerPeter Zijlstra <peterz@infradead.org>2020-04-30 20:14:32 +0200
commit87cf61fe848ca8ddf091548671e168f52e8a718e (patch)
tree5ce9737388ad3be7430ecfaf6e66e3170b00c45a /tools/objtool/check.c
parent1ff865e343c2b59469d7e41d370a980a3f972c71 (diff)
downloadlinux-87cf61fe848ca8ddf091548671e168f52e8a718e.tar.bz2
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
Diffstat (limited to 'tools/objtool/check.c')
-rw-r--r--tools/objtool/check.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index fa9bf364545c..8af8de2299e8 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -1484,7 +1484,7 @@ static int decode_sections(struct objtool_file *file)
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 &&
!strcmp(insn->call_dest->name, "__fentry__"))
return true;