Fix __errno for LP64 and clean up __get_tls.

If __get_tls has the right type, a lot of confusing casting can disappear.

It was probably a mistake that __get_tls was exposed as a function for mips
and x86 (but not arm), so let's (a) ensure that the __get_tls function
always matches the macro, (b) that we have the function for arm too, and
(c) that we don't have the function for any 64-bit architecture.

Change-Id: Ie9cb989b66e2006524ad7733eb6e1a65055463be
This commit is contained in:
Elliott Hughes
2013-10-08 18:50:24 -07:00
parent 777a4ee677
commit 2a0b873065
14 changed files with 56 additions and 104 deletions

View File

@@ -31,8 +31,7 @@
static pthread_mutex_t gDlMutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER;
static const char* __bionic_set_dlerror(char* new_value) {
void* tls = const_cast<void*>(__get_tls());
char** dlerror_slot = &reinterpret_cast<char**>(tls)[TLS_SLOT_DLERROR];
char** dlerror_slot = &reinterpret_cast<char**>(__get_tls())[TLS_SLOT_DLERROR];
const char* old_value = *dlerror_slot;
*dlerror_slot = new_value;