[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221208072813.25799-1-sv@linux.ibm.com>
Date: Thu, 8 Dec 2022 12:58:13 +0530
From: Sathvika Vasireddy <sv@...ux.ibm.com>
To: linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org
Cc: jpoimboe@...hat.com, peterz@...radead.org, aik@...abs.ru,
mpe@...erman.id.au, mingo@...hat.com, christophe.leroy@...roup.eu,
mbenes@...e.cz, npiggin@...il.com, chenzhongjin@...wei.com,
sfr@...b.auug.org.au, naveen.n.rao@...ux.vnet.ibm.com,
sv@...ux.ibm.com
Subject: [PATCH] objtool: continue if find_insn() fails in decode_instructions()
Currently, decode_instructions() is failing if it is not able to find
instruction, and this is happening since commit dbcdbdfdf137b4
("objtool: Rework instruction -> symbol mapping") because it is
expecting instruction for STT_NOTYPE symbols.
Due to this, the following objtool warnings are seen:
[1] arch/powerpc/kernel/optprobes_head.o: warning: objtool: optprobe_template_end(): can't find starting instruction
[2] arch/powerpc/kernel/kvm_emul.o: warning: objtool: kvm_template_end(): can't find starting instruction
[3] arch/powerpc/kernel/head_64.o: warning: objtool: end_first_256B(): can't find starting instruction
The warnings are thrown because find_insn() is failing for symbols that
are at the end of the file, or at the end of the section. Given how
STT_NOTYPE symbols are currently handled in decode_instructions(),
continue if the instruction is not found, instead of throwing warning
and returning.
Signed-off-by: Naveen N. Rao <naveen.n.rao@...ux.vnet.ibm.com>
Signed-off-by: Sathvika Vasireddy <sv@...ux.ibm.com>
---
tools/objtool/check.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 4350be739f4f..bce2be5ebf36 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -430,11 +430,8 @@ static int decode_instructions(struct objtool_file *file)
if (func->return_thunk || func->alias != func)
continue;
- if (!find_insn(file, sec, func->offset)) {
- WARN("%s(): can't find starting instruction",
- func->name);
- return -1;
- }
+ if (!find_insn(file, sec, func->offset))
+ continue;
sym_for_each_insn(file, func, insn) {
insn->sym = func;
--
2.31.1
Powered by blists - more mailing lists