tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Thread-local storage?


From: Michael Matz
Subject: Re: [Tinycc-devel] Thread-local storage?
Date: Wed, 4 Sep 2019 14:40:08 +0000 (UTC)
User-agent: Alpine 2.21 (LSU 202 2017-01-01)

Hi,

On Tue, 3 Sep 2019, Charles Lohr wrote:

> I've been trying to find a way out of this for a bit now.  I'd like to 
> carry over some optimizations to a TCC host compile, but, I'm stuck with 
> using pthread_key_create and friends.  This is a bit of an annoying 
> solution and not optimal... And potentially even rougher on Windows.
> 
> It looks like all the defines for the sections are in tccelf.h.  Is 
> there any hidden handshake sort of way to mark data for a thread local 
> section. .tbss?  I've tried __attribute__((section(".tbss"))) to no 
> avail; it just sticks them into .bss.  Any ideas?

The attribute works and puts the variable into the respective section just 
fine.  The problem is rather that thread local storage has to be manage 
quite differently and TCC is not doing that.

For instance, the .tbss section needs to be put into a different ELF 
segment of TLS type, the section type itself needs to be TLS as well, and 
then the code sequences to actually access the variables are completely 
different.

So, yes, merely putting the variables into .tbss sections doesn't work, 
and as of right now TCC doesn't support thread local storage.  I started 
working on this a couple months ago, but got distracted.  Maybe one of 
these days ... :)


Ciao,
Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]