Supporting emulated tls

Johannes Pfau nospam at example.com
Fri Mar 23 02:47:56 PDT 2012


Am Fri, 23 Mar 2012 06:06:39 +0100
schrieb "Martin Nowak" <dawg at dawgfoto.de>:

> On Mon, 19 Mar 2012 09:15:08 +0100, Johannes Pfau
> <nospam at example.com> wrote:
> 
> > And how do we get the TLS initialization data? If we placed it into
> > an array, like DMD does on OSX, we could use dlsym for dlopened
> > libraries, but what about initially loaded libraries?
> 
> That doesn't work because the symbols would collide.
> If you made them local symbols OTOH you can't access
> them through dlsym.
> Use dl_iterate_phdr to get the initial image.

I just saw your latest work on DSO yesterday (I was looking for a
status update for shared libraries as Android does not officially
support native applications. The supported way is to build a shared
library and load it into a JAVA app. And indeed, native applications
have some wierd corner cases (https://github.com/jpf91/GDC/issues/4).
Android is such a crappy platform for native apps...)
You're doing some awesome work there. I'm not sure what issues gdc had
with the original TLS support, but I guess that your new code will
probably solve those.

I guess the OSX emulated tls code will also be adapted to support
multiple modules? I guess we can just wait until your changes are
merged into DMD and then think about emulated TLS again.


More information about the D.gnu mailing list