From: Richard Biener <rguenther@suse.de>
To: Alan Modra <amodra@gmail.com>
Cc: Tobias Burnus <tobias@codesourcery.com>,
Binutils <binutils@sourceware.org>,
gcc-patches <gcc-patches@gcc.gnu.org>,
Joseph Myers <joseph@codesourcery.com>
Subject: Re: [RFC,patch] Linker plugin - extend API for offloading corner case (aka: LDPT_REGISTER_CLAIM_FILE_HOOK_V2 linker plugin hook [GCC PR109128])
Date: Thu, 11 May 2023 07:27:04 +0000 (UTC) [thread overview]
Message-ID: <nycvar.YFH.7.77.849.2305110726320.4723@jbgna.fhfr.qr> (raw)
In-Reply-To: <ZFw5kW+XHzqHWkF0@squeak.grove.modra.org>
On Thu, 11 May 2023, Alan Modra wrote:
> On Thu, May 04, 2023 at 11:02:25AM +0000, Richard Biener via Binutils wrote:
> > So since we expect the linker to use the host side table is there a way
> > for the plugin to exactly query that (the set of symbols the linker
> > uses from the object passed to the plugin)?
>
> That would be possible and relatively easy to implement, but might be
> slow.
>
> > Because if the linker
> > uses something from the file but _not_ the host side offload table
> > (-ffunction-sections -fdata-sections) then things would still go
> > wrong, right?
>
> > Is there a way to connect both in a way that the linker discards
> > either if the other isn't present?
>
> No, or at least I do not want to even think about implementing such a
> linker "feature". The problem is that after you have modified the
> global linker symbol table after adding an object's symbols, it is
> virtually impossible to restore the state of symbols to what they
> would be without that object. (Yes, we do that sort of thing for
> as-needed shared libraries, but the restoration happens immediately
> after adding the symbols. I also regret implementing it the way I
> did.)
Thanks for explaining.
> The patch posted is OK from the linker side of things.
OK, then lets go with it and hope it fixes the issue for good.
Thanks,
Richard.
prev parent reply other threads:[~2023-05-11 7:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-02 17:19 Tobias Burnus
2023-05-04 10:30 ` Tobias Burnus
2023-05-04 11:02 ` Richard Biener
2023-05-04 13:25 ` Tobias Burnus
2023-05-11 0:40 ` Alan Modra
2023-05-11 7:27 ` Richard Biener [this message]
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=nycvar.YFH.7.77.849.2305110726320.4723@jbgna.fhfr.qr \
--to=rguenther@suse.de \
--cc=amodra@gmail.com \
--cc=binutils@sourceware.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=joseph@codesourcery.com \
--cc=tobias@codesourcery.com \
/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).