]> git.saurik.com Git - apple/dyld.git/blob - unit-tests/test-cases/tlv-initializer/get.s
5116395d2456ad130e114dac876c71228fc6aa4d
[apple/dyld.git] / unit-tests / test-cases / tlv-initializer / get.s
1
2 # _a is zerofill global TLV
3 .tbss _a$tlv$init,4,2
4
5 # _b is an initialized global TLV
6 .tdata
7 _b$tlv$init:
8 .long 5
9
10
11 #if __x86_64__
12
13 # _a isĀ global TLV
14 .tlv
15 .globl _a
16 _a: .quad __tlv_bootstrap
17 .quad 0
18 .quad _a$tlv$init
19
20 # _b is a global TLV
21 .tlv
22 .globl _b
23 _b: .quad __tlv_bootstrap
24 .quad 0
25 .quad _b$tlv$init
26
27 # _myinit sets up TLV content
28 .thread_init_func
29 .quad _myinit
30
31
32 .text
33 .globl _get_a
34 _get_a:
35 pushq %rbp
36 movq %rsp, %rbp
37 movq _a@TLVP(%rip), %rdi
38 call *(%rdi)
39 popq %rbp
40 ret
41
42 .globl _get_b
43 _get_b:
44 pushq %rbp
45 movq %rsp, %rbp
46 movq _b@TLVP(%rip), %rdi
47 call *(%rdi)
48 popq %rbp
49 ret
50
51 #endif
52
53 #if __i386__
54
55 # _a isĀ global TLV
56 .tlv
57 .globl _a
58 _a: .long __tlv_bootstrap
59 .long 0
60 .long _a$tlv$init
61
62 # _b is a global TLV
63 .tlv
64 .globl _b
65 _b: .long __tlv_bootstrap
66 .long 0
67 .long _b$tlv$init
68
69 # _myinit sets up TLV content
70 .thread_init_func
71 .long _myinit
72
73
74 .text
75 .globl _get_a
76 _get_a:
77 pushl %ebp
78 movl %esp, %ebp
79 subl $8, %esp
80 movl _a@TLVP, %eax
81 call *(%eax)
82 movl %ebp, %esp
83 popl %ebp
84 ret
85
86 .globl _get_b
87 _get_b:
88 pushl %ebp
89 movl %esp, %ebp
90 subl $8, %esp
91 movl _b@TLVP, %eax
92 call *(%eax)
93 movl %ebp, %esp
94 popl %ebp
95 ret
96
97 #endif
98
99 .subsections_via_symbols