This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]