linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Gray <bgray@linux.ibm.com>
To: Andrew Donnellan <ajd@linux.ibm.com>, linuxppc-dev@lists.ozlabs.org
Cc: peterz@infradead.org, rostedt@goodmis.org, jpoimboe@kernel.org,
	jbaron@akamai.com, npiggin@gmail.com, ardb@kernel.org
Subject: Re: [PATCH v4 2/6] powerpc/module: Handle caller-saved TOC in module linker
Date: Wed, 26 Oct 2022 10:41:38 +1100	[thread overview]
Message-ID: <eb0c1f04e9b567936b2494ae9bf98859ce735915.camel@linux.ibm.com> (raw)
In-Reply-To: <05571d7c9bc1f8287cfd44ed519ba668d1cfdb86.camel@linux.ibm.com>

On Tue, 2022-10-25 at 13:10 +1100, Andrew Donnellan wrote:
> On Mon, 2022-10-10 at 11:29 +1100, Benjamin Gray wrote:
> > > A function symbol may set a value in the st_other field to
> > > indicate
> > > the TOC should be treated as caller-saved. The linker should
> > > ensure> the
> > > current TOC is saved before calling it and restore the TOC>
> > > afterwards,
> > > much like external calls.
> 
> As I suggested on the last revision, worth mentioning here that it's
> the '.localentry <NAME>, 1' directive we're talking about here.

Ah right, whoops. Added "For example, GCC and Clang support a
'.localentry <NAME>, 1' directive to set this explicitly in assembly."

The exact method for doing this seems to be nonstandard (GCC supports
arbitrary value in 1--7, Clang special cases only 1), so originally I
was avoiding specifying how it is set.

> > > @@ -632,7 +643,8 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
> > >                 case R_PPC_REL24:
> > >                         /* FIXME: Handle weak symbols here --RR
> > > */
> > >                         if (sym->st_shndx == SHN_UNDEF ||
> > > -                           sym->st_shndx == SHN_LIVEPATCH) {
> > > +                           sym->st_shndx == SHN_LIVEPATCH ||
> > > +                           need_r2save_stub(sym->st_other)) {
> > >                                 /* External: go via stub */
> 
> Perhaps this comment should be updated to mention that there are non-
> external but external-like calls?
> 
> Otherwise
> 
> Reviewed-by: Andrew Donnellan <ajd@linux.ibm.com>

Updated to "/* May use different / not preserve TOC: go via stub */",
will add your reviewed-by in the next version. For now I'll wait for
any other feedback before sending it.
> > 

  reply	other threads:[~2022-10-25 23:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-10  0:29 [PATCH v4 0/6] Out-of-line static calls for powerpc64 ELF V2 Benjamin Gray
2022-10-10  0:29 ` [PATCH v4 1/6] powerpc/code-patching: Implement generic text patching function Benjamin Gray
2022-10-10  4:45   ` Andrew Donnellan
2022-10-10  7:00     ` Andrew Donnellan
2022-10-10  0:29 ` [PATCH v4 2/6] powerpc/module: Handle caller-saved TOC in module linker Benjamin Gray
2022-10-25  2:10   ` Andrew Donnellan
2022-10-25 23:41     ` Benjamin Gray [this message]
2022-10-10  0:29 ` [PATCH v4 3/6] powerpc/module: Optimise nearby branches in ELF V2 ABI stub Benjamin Gray
2022-10-10  0:29 ` [PATCH v4 4/6] static_call: Move static call selftest to static_call_selftest.c Benjamin Gray
2022-10-10  0:29 ` [PATCH v4 5/6] powerpc/64: Add support for out-of-line static calls Benjamin Gray
2022-10-10  0:29 ` [PATCH v4 6/6] powerpc: Add tests " Benjamin Gray

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=eb0c1f04e9b567936b2494ae9bf98859ce735915.camel@linux.ibm.com \
    --to=bgray@linux.ibm.com \
    --cc=ajd@linux.ibm.com \
    --cc=ardb@kernel.org \
    --cc=jbaron@akamai.com \
    --cc=jpoimboe@kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=npiggin@gmail.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.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;
as well as URLs for NNTP newsgroup(s).