[PATCH] [libcxxabi] Add __cxa_thread_atexit for TLS support on Linux.

Jonathan Roelofs jonathan at codesourcery.com
Wed Dec 17 12:17:36 PST 2014



On 12/17/14 1:12 PM, Dan Albert wrote:
> On Wed, Dec 17, 2014 at 11:57 AM, Jonathan Roelofs <
> jonathan at codesourcery.com> wrote:
>>
>> ================
>> Comment at: test/cxa_thread_atexit_test.cpp:15
>> @@ +14,3 @@
>> +
>> +extern "C" int __cxa_thread_atexit_impl(void (*dtor)(void *), void *obj,
>> +                                        void *dso_symbol) {
>> ----------------
>> What about when the libc provides this symbol? Is it normally weak?
>>
>
> The dynamic linker satisfies the symbol from the main executable first,
> even if there is a strong symbol in another shared object.
Hm. What about with statically linked libc?
>
>
>>
>> ================
>> Comment at: test/cxa_thread_atexit_test.cpp:16
>> @@ +15,3 @@
>> +extern "C" int __cxa_thread_atexit_impl(void (*dtor)(void *), void *obj,
>> +                                        void *dso_symbol) {
>> +  assert(dtor == reinterpret_cast<void (*)(void *)>(1));
>> ----------------
>> to have the same signature, this needs throw().
>
>
> This is the _impl function, which doesn't have the throw() specifier (since
> it's C code). I suppose the throw() on the non-impl version of this is
> actually unnecessary since it's in extern "C". I had just match the Apple
> functions above my decl in cxxabi.h.
Ah, right.
>

-- 
Jon Roelofs
jonathan at codesourcery.com
CodeSourcery / Mentor Embedded



More information about the cfe-commits mailing list