Boost logo

Boost :

From: Aaron W. LaFramboise (aaronrabiddog51_at_[hidden])
Date: 2004-07-31 12:40:29


Bronek Kozicki wrote:
> Aaron W. LaFramboise wrote:
>
>>Following is an implementation of, and some comments on, a staticly
>>linked Boost.Thread thread exit handler for MSVC.
>
> Wow, great. It works on MSVC71, but not on MSVC6. I tried following,
> very simple test code, compiled with any of CRT variants /MD /MDd /MT or
> /MTd . What's meaning of data_seg(".CRT$XLB")?

How unfortunate. I think I have an 'introductory version' of MSVC6
somewhere around here. I will look at it and see if this is something
that can be fixed.

That pragma causes data to temporarily be put into a specific section.
In MS PE (I don't think this is specified in PECOFF), sections that have
identical names up to a $ character are merged consecutively at link
time. The characters after the $ specify the order the sections are
merged in. The code XLA, in this case, has a special, but as far as I
know, entirely undocumented meaning. The X appears to be some random
identifier. The L means 'TLS callback section.' Other options here are
C, for C initializers, I, for C++ global ctors, and P and T for global
dtors (the former is for "pre-termination"). The final B is an ordering
priority that can be anything A to Z, but it looked like it would be a
bad idea to use A.

Since this general .CRT mechanism was present in MSVC6, and that (as far
as I know) no new static TLS features were added by MSVC7.1, it seems
likely to me that this same TLS callback mechanism would be availible in
MSVC6. I'm going to check.

Aaron W. LaFramboise


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk