mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ard Biesheuvel <ardb@kernel.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] objtool: Detect non-relocated text references
Date: Fri, 4 Oct 2024 09:46:53 -0700	[thread overview]
Message-ID: <20241004164653.wntzsvsdd27pbcsw@treble> (raw)
In-Reply-To: <20241004082029.GG18071@noisy.programming.kicks-ass.net>

On Fri, Oct 04, 2024 at 10:20:29AM +0200, Peter Zijlstra wrote:
> On Fri, Oct 04, 2024 at 12:28:47AM -0700, Josh Poimboeuf wrote:
> > On Fri, Oct 04, 2024 at 08:54:16AM +0200, Ard Biesheuvel wrote:
> > > On Fri, 4 Oct 2024 at 02:31, Josh Poimboeuf <jpoimboe@kernel.org> wrote:
> > > > However there are some "lea xxx(%rip)" cases which don't use relocations
> > > > because they're referencing code in the same translation unit.
> > > 
> > > input section
> > 
> > "in the same translation unit and section" ?
> > 
> > > > However if we enable -fpie, the compiler would start generating them and
> > > > there would definitely be bugs in the IBT sealing.
> > > >
> > > 
> > > -fpie is guaranteed to break things, but even without it, Clang may
> > > issue RIP-relative LEA instructions (or LLD when it performs
> > > relaxations), so this is definitely worth addressing even if we don't
> > > enable -fpie.
> > 
> > I haven't seen this with Clang either.  Also, objtool runs before the
> > linker so LLD relaxations shouldn't matter.
> 
> LTO might have a few more cases, the input sections are bigger there.
> But even there we run before the final link stage.

Clang LTO uses -ffunction-sections so it shouldn't be possible.

-- 
Josh

  reply	other threads:[~2024-10-04 16:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-04  0:31 Josh Poimboeuf
2024-10-04  6:54 ` Ard Biesheuvel
2024-10-04  7:28   ` Josh Poimboeuf
2024-10-04  7:59     ` Ard Biesheuvel
2024-10-04  8:20     ` Peter Zijlstra
2024-10-04 16:46       ` Josh Poimboeuf [this message]
2024-10-04  8:21 ` 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=20241004164653.wntzsvsdd27pbcsw@treble \
    --to=jpoimboe@kernel.org \
    --cc=ardb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®