linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] objtool: continue if find_insn() fails in decode_instructions()
@ 2022-12-08  7:28 Sathvika Vasireddy
  2023-01-07 10:21 ` Ingo Molnar
  0 siblings, 1 reply; 5+ messages in thread
From: Sathvika Vasireddy @ 2022-12-08  7:28 UTC (permalink / raw)
  To: linux-kernel, linuxppc-dev
  Cc: sfr, peterz, aik, mingo, sv, npiggin, jpoimboe, naveen.n.rao,
	mbenes, chenzhongjin

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@linux.vnet.ibm.com>
Signed-off-by: Sathvika Vasireddy <sv@linux.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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-01-09 17:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-08  7:28 [PATCH] objtool: continue if find_insn() fails in decode_instructions() Sathvika Vasireddy
2023-01-07 10:21 ` Ingo Molnar
2023-01-09 12:42   ` Sathvika Vasireddy
2023-01-09 16:53     ` Ingo Molnar
2023-01-09 17:34       ` Sathvika Vasireddy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).