clarify the purpose of this project
[nyanglibc.git] / dlfcn / sdlsym.s
blob518fe1ec4b2b0577646bdb0843ccdd704df898af
1 .text
2 .p2align 4,,15
3 .type dlsym_doit, @function
4 dlsym_doit:
5 pushq %rbx
6 movq %rdi, %rbx
7 movq 16(%rdi), %rdx
8 movq 8(%rdi), %rsi
9 movq (%rdi), %rdi
10 call _dl_sym@PLT
11 movq %rax, 24(%rbx)
12 popq %rbx
13 ret
14 .size dlsym_doit, .-dlsym_doit
15 .p2align 4,,15
16 .globl __dlsym
17 .hidden __dlsym
18 .type __dlsym, @function
19 __dlsym:
20 pushq %rbx
21 subq $32, %rsp
22 cmpq $0, __pthread_mutex_lock@GOTPCREL(%rip)
23 movq %rdx, 16(%rsp)
24 movq %rdi, (%rsp)
25 movq %rsi, 8(%rsp)
26 je .L5
27 leaq _dl_load_lock(%rip), %rdi
28 call __pthread_mutex_lock@PLT
29 .L5:
30 leaq dlsym_doit(%rip), %rdi
31 movq %rsp, %rsi
32 call _dlerror_run
33 testl %eax, %eax
34 jne .L8
35 movq 24(%rsp), %rbx
36 .L6:
37 cmpq $0, __pthread_mutex_unlock@GOTPCREL(%rip)
38 je .L4
39 leaq _dl_load_lock(%rip), %rdi
40 call __pthread_mutex_unlock@PLT
41 .L4:
42 addq $32, %rsp
43 movq %rbx, %rax
44 popq %rbx
45 ret
46 .p2align 4,,10
47 .p2align 3
48 .L8:
49 xorl %ebx, %ebx
50 jmp .L6
51 .size __dlsym, .-__dlsym
52 .weak __pthread_mutex_unlock
53 .weak __pthread_mutex_lock
54 .hidden _dlerror_run