clarify the purpose of this project
[nyanglibc.git] / dlfcn / sdlmopen.s
blobb3ea59bb9c567acea358cbdfd237bb8e7ca8b69c
1 .text
2 .section .rodata.str1.1,"aMS",@progbits,1
3 .LC0:
4 .string ""
5 .LC1:
6 .string "invalid namespace"
7 .text
8 .p2align 4,,15
9 .type dlmopen_doit, @function
10 dlmopen_doit:
11 pushq %rbx
12 cmpq $0, (%rdi)
13 jne .L6
14 movq 32(%rdi), %rdx
15 movl 16(%rdi), %esi
16 movq %rdi, %rbx
17 movq 8(%rdi), %rdi
18 leaq .LC0(%rip), %rax
19 movq __libc_argv(%rip), %r9
20 movl __libc_argc(%rip), %r8d
21 orl $-2147483648, %esi
22 testq %rdi, %rdi
23 cmove %rax, %rdi
24 subq $8, %rsp
25 pushq __environ(%rip)
26 xorl %ecx, %ecx
27 call _dl_open
28 movq %rax, 24(%rbx)
29 popq %rax
30 popq %rdx
31 popq %rbx
32 ret
33 .L6:
34 leaq .LC1(%rip), %rcx
35 xorl %edx, %edx
36 xorl %esi, %esi
37 movl $22, %edi
38 call _dl_signal_error
39 .size dlmopen_doit, .-dlmopen_doit
40 .p2align 4,,15
41 .globl __dlmopen
42 .hidden __dlmopen
43 .type __dlmopen, @function
44 __dlmopen:
45 subq $56, %rsp
46 movq %rdi, (%rsp)
47 leaq dlmopen_doit(%rip), %rdi
48 movq %rsi, 8(%rsp)
49 movq %rsp, %rsi
50 movl %edx, 16(%rsp)
51 movq %rcx, 32(%rsp)
52 call _dlerror_run
53 testl %eax, %eax
54 jne .L9
55 movq 24(%rsp), %rdi
56 call __libc_register_dl_open_hook
57 movq 24(%rsp), %rdi
58 call __libc_register_dlfcn_hook
59 movq 24(%rsp), %rax
60 addq $56, %rsp
61 ret
62 .p2align 4,,10
63 .p2align 3
64 .L9:
65 xorl %eax, %eax
66 addq $56, %rsp
67 ret
68 .size __dlmopen, .-__dlmopen
69 .hidden __libc_register_dlfcn_hook
70 .hidden __libc_register_dl_open_hook
71 .hidden _dlerror_run
72 .hidden _dl_signal_error
73 .hidden _dl_open
74 .hidden __libc_argc
75 .hidden __libc_argv