ld: Update function prototypes for compilers defaulting to -std=gnu23
[binutils-gdb.git] / ld / testsuite / ld-x86-64 / tlsbindesc.s
blob39ba3bbaa9f6c4beac64bee136c3fd09616b2c91
1 /* Force .data aligned to 4K, so that .got very likely gets at
2 0x5021a0 (0x60 bytes .tdata and 0x140 bytes .dynamic) */
3 .data
4 .balign 4096
5 .section ".tdata", "awT", @progbits
6 .globl sg1, sg2, sg3, sg4, sg5, sg6, sg7, sg8
7 .globl sh1, sh2, sh3, sh4, sh5, sh6, sh7, sh8
8 .hidden sh1, sh2, sh3, sh4, sh5, sh6, sh7, sh8
9 sg1: .long 17
10 sg2: .long 18
11 sg3: .long 19
12 sg4: .long 20
13 sg5: .long 21
14 sg6: .long 22
15 sg7: .long 23
16 sg8: .long 24
17 sl1: .long 65
18 sl2: .long 66
19 sl3: .long 67
20 sl4: .long 68
21 sl5: .long 69
22 sl6: .long 70
23 sl7: .long 71
24 sl8: .long 72
25 sh1: .long 257
26 sh2: .long 258
27 sh3: .long 259
28 sh4: .long 260
29 sh5: .long 261
30 sh6: .long 262
31 sh7: .long 263
32 sh8: .long 264
33 /* Force .text aligned to 4K, so it very likely gets at 0x401000. */
34 .text
35 .balign 4096
36 .globl fn2
37 .type fn2,@function
38 fn2:
39 pushq %rbp
40 movq %rsp, %rbp
42 /* GD -> IE because variable is not defined in executable */
43 leaq sG1@tlsdesc(%rip), %rax
44 call *sG1@tlscall(%rax)
45 nop;nop;nop;nop
47 /* GD -> IE because variable is not defined in executable where
48 the variable is referenced through IE too */
49 leaq sG2@tlsdesc(%rip), %rax
50 call *sG2@tlscall(%rax)
51 nop;nop;nop;nop
53 /* GD -> LE with global variable defined in executable */
54 leaq sg1@tlsdesc(%rip), %rax
55 call *sg1@tlscall(%rax)
56 nop;nop;nop;nop
58 /* GD -> LE with local variable defined in executable */
59 leaq sl1@tlsdesc(%rip), %rax
60 call *sl1@tlscall(%rax)
61 nop;nop;nop;nop
63 /* GD -> LE with hidden variable defined in executable */
64 leaq sh1@tlsdesc(%rip), %rax
65 call *sh1@tlscall(%rax)
66 nop;nop;nop;nop
68 /* LD -> LE */
69 leaq _TLS_MODULE_BASE_@tlsdesc(%rip), %rax
70 call *_TLS_MODULE_BASE_@tlscall(%rax)
71 nop;nop
72 leaq 1+sl1@dtpoff(%rax), %rdx
73 nop;nop
74 leaq sl2@dtpoff+2(%rax), %r9
75 nop;nop;nop;nop
77 /* LD -> LE against hidden variables */
78 leaq sh1@dtpoff(%rax), %rdx
79 nop;nop
80 leaq 3+sh2@dtpoff(%rax), %rcx
81 nop;nop;nop;nop
83 /* IE against global var */
84 movq %fs:0, %r9
85 nop;nop
86 addq sG2@gottpoff(%rip), %r9
87 nop;nop;nop;nop
89 /* IE -> LE against global var defined in exec */
90 movq %fs:0, %r10
91 nop;nop
92 addq sg1@gottpoff(%rip), %r10
93 nop;nop;nop;nop
95 /* IE -> LE against local var */
96 movq %fs:0, %rax
97 nop;nop
98 addq sl1@gottpoff(%rip), %rax
99 nop;nop;nop;nop
101 /* IE -> LE against hidden var */
102 movq %fs:0, %rcx
103 nop;nop
104 addq sh1@gottpoff(%rip), %rcx
105 nop;nop;nop;nop
107 /* Direct access through %fs */
109 /* IE against global var */
110 movq sG5@gottpoff(%rip), %rcx
111 nop;nop
112 movq %fs:(%rcx), %rdx
113 nop;nop;nop;nop
115 /* IE->LE against local var */
116 movq sl5@gottpoff(%rip), %r11
117 nop;nop
118 movq %fs:(%r11), %r12
119 nop;nop;nop;nop
121 /* IE->LE against hidden var */
122 movq sh5@gottpoff(%rip), %rdx
123 nop;nop
124 movq %fs:(%rdx), %rdx
125 nop;nop;nop;nop
127 leave
130 /* IE against global var */
131 addq sG2@gottpoff(%rip), %r16
132 addq %rax, sG2@gottpoff(%rip), %r16
133 addq sG2@gottpoff(%rip), %rax, %r16
134 {nf} addq sG2@gottpoff(%rip), %r16
135 {nf} addq %rax, sG2@gottpoff(%rip), %r16
136 {nf} addq sG2@gottpoff(%rip), %rax, %r16
138 /* IE -> LE against global var defined in exec */
139 addq sg1@gottpoff(%rip), %r17
140 addq %r8, sg1@gottpoff(%rip), %r17
141 addq sg1@gottpoff(%rip), %r8, %r17
142 {nf} addq sg1@gottpoff(%rip), %r17
143 {nf} addq %r8, sg1@gottpoff(%rip), %r17
144 {nf} addq sg1@gottpoff(%rip), %r8, %r17
146 /* IE -> LE against local var */
147 addq sl1@gottpoff(%rip), %r18
148 addq %r8, sl1@gottpoff(%rip), %rax
149 addq sl1@gottpoff(%rip), %r8, %rax
150 {nf} addq sl1@gottpoff(%rip), %r18
151 {nf} addq %r8, sl1@gottpoff(%rip), %rax
152 {nf} addq sl1@gottpoff(%rip), %r8, %rax
154 /* IE -> LE against hidden var */
155 addq sh1@gottpoff(%rip), %r19
156 addq %r19, sh1@gottpoff(%rip), %r8
157 addq sh1@gottpoff(%rip), %r19, %r8
158 {nf} addq sh1@gottpoff(%rip), %r19
159 {nf} addq %r19, sh1@gottpoff(%rip), %r8
160 {nf} addq sh1@gottpoff(%rip), %r19, %r8
162 /* Direct access through %fs */
164 /* IE against global var */
165 movq sG5@gottpoff(%rip), %r20
167 /* IE->LE against local var */
168 movq sl5@gottpoff(%rip), %r21
170 /* IE->LE against hidden var */
171 movq sh5@gottpoff(%rip), %r22
173 /* GD -> IE because variable is not defined in executable */
174 leaq sG1@tlsdesc(%rip), %r16
176 /* GD -> IE because variable is not defined in executable where
177 the variable is referenced through IE too */
178 leaq sG2@tlsdesc(%rip), %r17
180 /* GD -> LE with global variable defined in executable */
181 leaq sg1@tlsdesc(%rip), %r18
183 /* GD -> LE with local variable defined in executable */
184 leaq sl1@tlsdesc(%rip), %r19
186 /* GD -> LE with hidden variable defined in executable */
187 leaq sh1@tlsdesc(%rip), %r20