Re: [RFC PATCH] objtool: Skip unannotated intra-function call warning for bl+mflr pattern

From
Peter Zijlstra <peterz@infradead.org>
Date
2025-02-24 16:25:47
Also in
lkml, llvm
Reply to
Sathvika Vasireddy, 2025-02-21
On Fri, Feb 21, 2025 at 02:20:41PM +0530, Sathvika Vasireddy wrote:
quoted
quoted
@@ -1625,6 +1626,11 @@ static int add_call_destinations(struct objtool_file *file)
  		reloc = insn_reloc(file, insn);
  		if (!reloc) {
  			dest_off = arch_jump_destination(insn);
+
+			next_insn = next_insn_same_func(file, insn);
+			if (next_insn && dest_off == next_insn->offset)
+				continue;
+
This won't work on x86, where an intra-function call is converted to a
stack-modifying JUMP.  So this should probably be checked in an
arch-specific function.
Thanks for letting me know, I'll introduce arch_skip_call_warning() to
handle architecture specific cases in the next patch I send.
Can't you detect this pattern in decode and simpy not emit the call
instruction?
Thread (12 messages) 12 messages, 5 authors, last reply 2025-02-25
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help