public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@gmail.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [RS6000] Power10 libffi fixes
Date: Thu, 24 Sep 2020 13:11:02 +0930	[thread overview]
Message-ID: <20200924034102.GJ5452@bubble.grove.modra.org> (raw)
In-Reply-To: <20200923001657.GQ28786@gate.crashing.org>

On Tue, Sep 22, 2020 at 07:16:57PM -0500, Segher Boessenkool wrote:
> Hi!
> 
> On Tue, Sep 22, 2020 at 10:00:11AM +0930, Alan Modra wrote:
> > gcc/
> > 	* config/rs6000/rs6000-c.c (rs6000_target_modify_macros):
> > 	Conditionally define __PCREL__.
> 
> Please do that as a separate (earlier) patch (because it *is*, and to
> simplify backports, etc).

Done.

> > libffi/
> > 	* src/powerpc/linux64.S (ffi_call_LINUX64): Don't emit global
> > 	entry when __PCREL__.  Call using @notoc.
> > 	(ffi_closure_LINUX64, ffi_go_closure_linux64): Likewise.
> 
> This is okay for trunk, and for backports (possibly expedited, talk
> with Peter for what is wanted/needed for AT).

I've fixed the changelog, a comment, and added a nop after bl for the
old calls without @notoc.  While there really isn't a need for the
nops in libffi.so since the callee is hidden visibility, there is a
miniscule chance that a static libffi.a user has a very large TOC and
somehow manages to have ffi_call_LINUX64 and ffi_prep_args64 using
different TOC pointers.  In that case the linker would arrange the
call to go via a toc-adjusting stub and want to replace the nop with a
toc restore.

-- 
Alan Modra
Australia Development Lab, IBM

  reply	other threads:[~2020-09-24  3:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-22  0:30 Alan Modra
2020-09-23  0:16 ` Segher Boessenkool
2020-09-24  3:41   ` Alan Modra [this message]
2020-09-24  5:39     ` Alan Modra

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=20200924034102.GJ5452@bubble.grove.modra.org \
    --to=amodra@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=segher@kernel.crashing.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 read-only IMAP folder(s) and NNTP newsgroup(s).