Re: [PATCH 1/3] Revert "x86/retpoline: Remove .text..__x86.return_thunk section"

From: Josh Poimboeuf
Date: Wed Oct 11 2023 - 12:28:50 EST


On Wed, Oct 11, 2023 at 09:41:42AM +0200, Peter Zijlstra wrote:
> > +++ b/tools/objtool/check.c
> > @@ -1610,6 +1610,15 @@ static int add_jump_destinations(struct objtool_file *file)
> > return -1;
> > }
> >
> > + /*
> > + * Since retpolines are in the same section as the return
> > + * thunk, they might not use a relocation when branching to it.
> > + */
> > + if (jump_dest->sym && jump_dest->sym->return_thunk) {
> > + add_return_call(file, insn, true);
> > + continue;
> > + }
>
> *urgh*... I mean, yes, that obviously works, but should we not also have
> the retpoline thingy for consistency? That case makes less sense though
> :/

Consistency with what? The extra section seems pointless but maybe I'm
missing something.

--
Josh