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

Peter Zijlstra peterz at infradead.org
Tue Feb 25 03:25:42 AEDT 2025


On Fri, Feb 21, 2025 at 02:20:41PM +0530, Sathvika Vasireddy wrote:

> > > @@ -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?


More information about the Linuxppc-dev mailing list