OSDN Git Service

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