This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
planning to implement win32 Thread Local Storage in Binutils
- From: Jonathan Wilson <jonwil at tpgi dot com dot au>
- To: binutils at sources dot redhat dot com
- Date: Sat, 11 Oct 2003 06:51:38 +0800
- Subject: planning to implement win32 Thread Local Storage in Binutils
I want to implement this in GNU Binutils as a first step to implementing it
in GNU GCC (i.e. if it can link a Visual C obj that does TLS plus sutable
runtime functions into a working exe file, it will be considered working)
Essentially, it needs 3 things:
1.a "clone" of tlssup.obj from MS (which basicly declares some variables
but in special segments), I am working on this
2.linker support for emitting the correct value in the TLS field in the PE
header (it should point to something in tlssup.obj
and 3.support for the special way that microsoft link merges sections.
Basicly, the folowing sections would be written out in the folowing order:
a section named .tls
a section named .tls$
a section named .tls$zzz
all sections would be combined into one section (in this case named .tls)
The exact order that sections will be combined in is unclear but basicly,
the segment without the $ comes first then those with just a $ then those
with stuff after the $.
So, I need to know:
1.how to implement the special linker support to combine sections the way
microsoft does it (being that MingW claims to be able to use code written
with visual C++ thats not C++ (i.e. straight C) supporting TLS the same way
MS does it makes sense)
and 2.where to modify to set the field in the PE header to point at the TLS
directory.