History log of /bionic/libc/bionic/__cxa_thread_atexit_impl.cpp
Revision Date Author Comments
06016f226efe7aff2736643cb8e719c513948ecc 05-Jan-2018 dimitry <dimitry@google.com> Fix dlclose for libraries with thread_local dtors

Introduce new flag to mark soinfo as TLS_NODELETE when
there are thread_local dtors associated with dso_handle
belonging to it.

Test: bionic-unit-tests --gtest_filter=dl*
Test: bionic-unit-tests-glibc --gtest_filter=dl*
Bug: https://github.com/android-ndk/ndk/issues/360
Change-Id: I724ef89fc899788f95c47e6372c38b3313f18fed
fa432524a66e5797874ef50e4ede95ded4cee199 25-Oct-2017 dimitry <dimitry@google.com> Mark __BIONIC_WEAK_FOR_NATIVE_BRIDGE symbols

To make it easier for Native Bridge implementations
to override these symbols.

Bug: http://b/67993967
Test: make
Change-Id: I4c53e53af494bca365dd2b3305ab0ccc2b23ba44
42d949ff9d2956e25f84e537f43a8f93ecb37baf 07-Jan-2016 Elliott Hughes <enh@google.com> Defend against -fstack-protector in libc startup.

Exactly which functions get a stack protector is up to the compiler, so
let's separate the code that sets up the environment stack protection
requires and explicitly build it with -fno-stack-protector.

Bug: http://b/26276517
Change-Id: I8719e23ead1f1e81715c32c1335da868f68369b5
952e9eb0866bc2061b671e8d6c90cae275eda6bd 25-Nov-2015 Yabin Cui <yabinc@google.com> Don't use __thread in __cxa_thread_finalize().

Currently we use __thread variable to store thread_local_dtors,
which makes tsan test fork_atexit.cc hang. The problem is as below:
The main thread creates a worker thread, the worker thread calls
pthread_exit() -> __cxa_thread_finalize() -> __emutls_get_address()
-> pthread_once(emutls_init) -> emutls_init().
Then the main thread calls fork(), the child process cals
exit() -> __cxa_thread_finalize() -> __emutls_get_address()
-> pthread_once(emutls_init).
So the child process is waiting for pthread_once(emutls_init)
to finish which will never occur.

It might be the test's fault because POSIX standard says if a
multi-threaded process calls fork(), the new process may only
execute async-signal-safe operations until exec functions are
called. And exit() is not async-signal-safe. But we can make
bionic more reliable by not using __thread in
__cxa_thread_finalize().

Bug: 25392375
Change-Id: Ife403dd7379dad8ddf1859c348c1c0adea07afb3
66aa0b61f736678e97a0cfaf975052881a23651b 15-Apr-2015 Dmitriy Ivanov <dimitry@google.com> Hide emutls* symbols in libc.so

Also make thread_local in test static to avoid ld.bfd
warning for arm64.

Change-Id: I09a3f2aa9b73a4fafa3f3bbc64ddc2a128ad50ee
df79c330d895af31f39ee301dee62731fa586168 26-Mar-2015 Dmitriy Ivanov <dimitry@google.com> Initial implementation of __cxa_thread_atexit_impl

This is initial implementations; does not yet handle
dlclose - undefined behavior, needs linker support to
handle it right.

Bug: 19800080
Bug: 16696563
Change-Id: I7a3e21ed7f7ec01e62ea1b7cb2ab253590ea0686