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

Dan Albert danalbert at google.com
Wed Dec 17 12:12:40 PST 2014


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.


>
> ================
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141217/68b77346/attachment.html>


More information about the cfe-commits mailing list