Index: lib/builtins/emutls.c =================================================================== --- lib/builtins/emutls.c +++ lib/builtins/emutls.c @@ -390,3 +390,11 @@ array->data[index] = emutls_allocate_object(control); return array->data[index]; } + +#ifdef __BIONIC__ +/* Called by Bionic on dlclose to delete the emutls pthread key. */ +__attribute__((visibility("hidden"))) +void __emutls_unregister_key(void) { + pthread_key_delete(emutls_pthread_key); +} +#endif