Re: [RFC 21/31] objtool: Fix x86 addend calcuation

From: Josh Poimboeuf
Date: Wed Sep 04 2024 - 12:16:54 EST


On Wed, Sep 04, 2024 at 05:24:21PM +0800, laokz wrote:
> On Mon, 2024-09-02 at 21:00 -0700, Josh Poimboeuf wrote:
> > +++ b/tools/objtool/arch/loongarch/decode.c
> > @@ -20,9 +20,9 @@ unsigned long arch_jump_destination(struct
> > instruction *insn)
> >         return insn->offset + (insn->immediate << 2);
> >  }
> >  
> > -unsigned long arch_dest_reloc_offset(int addend)
> > +s64 arch_insn_adjusted_addend(struct instruction *insn, struct reloc
> > *reloc)
> >  {
> > -       return addend;
> > +       return reloc_addend(addend);
>
> reloc_addend(reloc) ?

Oops!

As you can probably tell, I haven't tested (or compiled) anything other
than x86 yet.

--
Josh