From: Fangrui Song <maskray@google.com>
To: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Cc: gcc-patches@gcc.gnu.org, Jeff Law <jeffreyalaw@gmail.com>,
Rui Ueyama <rui314@gmail.com>,
ruiu@bluewhale.systems, kito.cheng@gmail.com
Subject: Re: [PATCH v2] RISC-V: Implement TLS Descriptors.
Date: Wed, 15 Nov 2023 21:33:29 -0800 [thread overview]
Message-ID: <CAFP8O3Kgm6AuLn7Du8RBwRFpO-VifjWjqGAMT5FjHjrmkDeBiA@mail.gmail.com> (raw)
In-Reply-To: <55ee8943-babd-4fb2-aaab-ca88e37683b7@gmail.com>
On Wed, Nov 15, 2023 at 9:23 PM Jeff Law <jeffreyalaw@gmail.com> wrote:
>
>
>
> On 11/15/23 18:51, Tatsuyuki Ishi wrote:
> >> On Nov 16, 2023, at 10:07, Jeff Law <jeffreyalaw@gmail.com> wrote:
>
> >
> > Based on what I have read in the AArch64 backend, there are two ways to
> > do this: introduce a custom calling convention, or put in a RTX insn
> > that covers the whole sequence. Ideally we should do the first, but then
> > there’s the label issue and it’s quite a bit more complicated. So I’m
> > sticking with this for now.
> As I said, I think we're OK here. We can always revamp as we get
> experience with the implementation -- I don't think any of the stuff
> we're talking about is an ABI change, they're just implementation details.
>
> >
> > Sorry for all the delay on this. My progress has been (and still)
> > blocked on supporting relaxation of TLSDESC in binutils (turns out you
> > can’t run static binaries without relaxing it first). But that doesn’t
> > seem exactly easy to do either, because relaxation that involves GOT
> > elimination isn’t something we have in the RISC-V backend.
> Note that binutils is due for another release in the next month or two.
> It'd certainly be helpful to have any issues there resolved in time for
> that release.
>
> >
> > I’ll try to send a new version of this patch and get this unblocked on
> > GCC side first.
> Sounds good. We can always guard its use behind a feature test for GAS
> support.
>
> Jeff
Agreed.
Tatsuyuki, could you also add some tests? For example
// end of https://maskray.me/blog/2021-02-14-all-about-thread-local-storage
__thread int tls0;
extern __thread int tls1;
int foo() { return ++tls0 + ++tls1; }
static __thread int tls2, tls3;
int bar() { return ++tls2 + ++tls3; }
I have used this to check rtld and linker behavior. I think we need
some `scan-assembler`.
To make it a runnable test, some assembler feature check may be
needed. Perhaps Jeff can make some suggestion or contribute code!
--
宋方睿
next prev parent reply other threads:[~2023-11-16 5:33 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-17 18:12 [PATCH] " Tatsuyuki Ishi
2023-08-29 13:40 ` Kito Cheng
2023-09-08 10:49 ` [PATCH v2] " Tatsuyuki Ishi
2023-10-02 14:10 ` Kito Cheng
2023-11-16 1:17 ` Fangrui Song
2023-11-16 1:39 ` Tatsuyuki Ishi
2023-11-16 5:21 ` Jeff Law
2023-11-16 5:18 ` Jeff Law
2023-11-16 1:07 ` Jeff Law
2023-11-16 1:51 ` Tatsuyuki Ishi
2023-11-16 5:23 ` Jeff Law
2023-11-16 5:33 ` Fangrui Song [this message]
2023-11-16 5:36 ` Jeff Law
2023-11-16 5:37 ` Tatsuyuki Ishi
2023-11-20 13:17 ` [PATCH v3] " Tatsuyuki Ishi
2023-11-21 6:59 ` Fangrui Song
2023-11-21 7:07 ` Tatsuyuki Ishi
2023-12-05 16:49 ` Tatsuyuki Ishi
2023-11-23 10:57 ` Florian Weimer
2023-11-23 11:34 ` Tatsuyuki Ishi
2023-11-23 11:40 ` Florian Weimer
2023-12-05 7:01 ` [PATCH v4] " Tatsuyuki Ishi
2024-01-27 3:24 ` Fangrui Song
2024-03-29 5:52 ` [PATCH v5] " Tatsuyuki Ishi
2024-03-29 6:32 ` Kito Cheng
2024-04-08 14:31 ` Kito Cheng
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=CAFP8O3Kgm6AuLn7Du8RBwRFpO-VifjWjqGAMT5FjHjrmkDeBiA@mail.gmail.com \
--to=maskray@google.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=ishitatsuyuki@gmail.com \
--cc=jeffreyalaw@gmail.com \
--cc=kito.cheng@gmail.com \
--cc=rui314@gmail.com \
--cc=ruiu@bluewhale.systems \
/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).