From 81e18eb3cd61f7b68a8f99b3e6c728f2a4d79221 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 14 Apr 2015 23:45:08 -0400 Subject: use hidden __tls_get_new for tls/tlsdesc lookup fallback cases previously, the dynamic tlsdesc lookup functions and the i386 special-ABI ___tls_get_addr (3 underscores) function called __tls_get_addr when the slot they wanted was not already setup; __tls_get_addr would then in turn also see that it's not setup and call __tls_get_new. calling __tls_get_new directly is both more efficient and avoids the issue of calling a non-hidden (public API/ABI) function from asm. for the special i386 function, a weak reference to __tls_get_new is used since this function is not defined when static linking (the code path that needs it is unreachable in static-linked programs). --- src/thread/i386/tls.s | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/thread') diff --git a/src/thread/i386/tls.s b/src/thread/i386/tls.s index 6e01adf2..76d5d462 100644 --- a/src/thread/i386/tls.s +++ b/src/thread/i386/tls.s @@ -10,6 +10,8 @@ ___tls_get_addr: add (%edx,%ecx,4),%eax ret 1: push %eax - call __tls_get_addr +.weak __tls_get_new +.hidden __tls_get_new + call __tls_get_new pop %edx ret -- cgit v1.2.1