use hidden __tls_get_new for tls/tlsdesc lookup fallback cases
[oweals/musl.git] / src / ldso / i386 / tlsdesc.s
1 .text
2 .global __tlsdesc_static
3 .type __tlsdesc_static,@function
4 __tlsdesc_static:
5         mov 4(%eax),%eax
6         ret
7
8 .hidden __tls_get_new
9
10 .global __tlsdesc_dynamic
11 .type __tlsdesc_dynamic,@function
12 __tlsdesc_dynamic:
13         mov 4(%eax),%eax
14         push %edx
15         mov %gs:4,%edx
16         push %ecx
17         mov (%eax),%ecx
18         cmp %ecx,(%edx)
19         jc 1f
20         mov 4(%eax),%eax
21         add (%edx,%ecx,4),%eax
22 2:      pop %ecx
23         sub %gs:0,%eax
24         pop %edx
25         ret
26 1:      push %eax
27         call __tls_get_new
28         pop %ecx
29         jmp 2b