All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org,
	sfr@canb.auug.org.au, mbenes@suse.cz
Subject: Re: [PATCH] objtool: Teach get_alt_entry() about more relocation types
Date: Thu, 30 Sep 2021 10:41:37 -0700	[thread overview]
Message-ID: <20210930174137.atf6tuzgd2iivx3c@treble> (raw)
In-Reply-To: <YVWUvknIEVNkPvnP@hirez.programming.kicks-ass.net>

On Thu, Sep 30, 2021 at 12:43:10PM +0200, Peter Zijlstra wrote:
> 
> Occasionally objtool encounters symbol (as opposed to section)
> relocations in .altinstructions. Typically they are the alternatives
> written by elf_add_alternative() as encountered on a noinstr
> validation run on vmlinux after having already ran objtool on the
> individual .o files.
> 
> Basically this is the counterpart of commit 44f6a7c0755d ("objtool:
> Fix seg fault with Clang non-section symbols"), because when these new
> assemblers (binutils now also does this) strip the section symbols,
> elf_add_reloc_to_insn() is forced to emit symbol based relocations.
> 
> As such, teach get_alt_entry() about different relocation types.
> 
> Fixes: 9bc0bb50727c ("objtool/x86: Rewrite retpoline thunk calls")
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Reported-by: Borislav Petkov <bp@alien8.de>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> ---
>  tools/objtool/special.c |   32 +++++++++++++++++++++++++-------
>  1 file changed, 25 insertions(+), 7 deletions(-)
> 
> --- a/tools/objtool/special.c
> +++ b/tools/objtool/special.c
> @@ -58,6 +58,24 @@ void __weak arch_handle_alternative(unsi
>  {
>  }
>  
> +static bool reloc2sec_off(struct reloc *reloc, struct section **sec, unsigned long *off)

Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>

Though I'd prefer U change it 2 a function name which doesn't look like
a Prince song title.

-- 
Josh


  parent reply	other threads:[~2021-09-30 17:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-30 10:43 [PATCH] objtool: Teach get_alt_entry() about more relocation types Peter Zijlstra
2021-09-30 17:32 ` Nathan Chancellor
2021-09-30 17:41 ` Josh Poimboeuf [this message]
2021-10-01 12:10 ` [tip: objtool/urgent] " tip-bot2 for Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210930174137.atf6tuzgd2iivx3c@treble \
    --to=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=peterz@infradead.org \
    --cc=sfr@canb.auug.org.au \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.