1 |
128 |
khays |
#source: tlsbindesc.s
|
2 |
|
|
#source: tlsbin.s
|
3 |
|
|
#as: --64
|
4 |
157 |
khays |
#ld: -shared -melf_x86_64 --no-ld-generated-unwind-info
|
5 |
128 |
khays |
#objdump: -drj.text
|
6 |
|
|
#target: x86_64-*-*
|
7 |
|
|
|
8 |
|
|
# PT_TLS layout is:
|
9 |
|
|
# Offset from Offset from Name
|
10 |
|
|
# TCB base TCB end
|
11 |
|
|
# 0x00 -0xa0 sg1..sg8
|
12 |
|
|
# 0x20 -0x80 sl1..sl8
|
13 |
|
|
# 0x40 -0x60 sh1..sh8
|
14 |
|
|
# 0x60 -0x40 bg1..bg8
|
15 |
|
|
# 0x80 -0x20 bl1..bl8
|
16 |
|
|
|
17 |
|
|
.*: +file format elf64-x86-64
|
18 |
|
|
|
19 |
|
|
Disassembly of section .text:
|
20 |
|
|
|
21 |
|
|
0+401000 :
|
22 |
|
|
[0-9a-f]+: 55[ ]+push %rbp
|
23 |
|
|
[0-9a-f]+: 48 89 e5[ ]+mov %rsp,%rbp
|
24 |
|
|
# GD -> IE because variable is not defined in executable
|
25 |
|
|
[0-9a-f]+: 48 8b 05 6d 03 20 00[ ]+mov 0x20036d\(%rip\),%rax +# 601378 <.*>
|
26 |
|
|
# -> R_X86_64_TPOFF64 sG1
|
27 |
|
|
[0-9a-f]+: 66 90[ ]+xchg %ax,%ax
|
28 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
29 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
30 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
31 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
32 |
|
|
# GD -> IE because variable is not defined in executable where
|
33 |
|
|
# the variable is referenced through IE too
|
34 |
|
|
[0-9a-f]+: 48 8b 05 50 03 20 00[ ]+mov 0x200350\(%rip\),%rax +# 601368 <.*>
|
35 |
|
|
# -> R_X86_64_TPOFF64 sG2
|
36 |
|
|
[0-9a-f]+: 66 90[ ]+xchg %ax,%ax
|
37 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
38 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
39 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
40 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
41 |
|
|
# GD -> LE with global variable defined in executable
|
42 |
|
|
[0-9a-f]+: 48 c7 c0 60 ff ff ff[ ]+mov \$0xf+60,%rax
|
43 |
|
|
# sg1
|
44 |
|
|
[0-9a-f]+: 66 90[ ]+xchg %ax,%ax
|
45 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
46 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
47 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
48 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
49 |
|
|
# GD -> LE with local variable defined in executable
|
50 |
|
|
[0-9a-f]+: 48 c7 c0 80 ff ff ff[ ]+mov \$0xf+80,%rax
|
51 |
|
|
# sl1
|
52 |
|
|
[0-9a-f]+: 66 90[ ]+xchg %ax,%ax
|
53 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
54 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
55 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
56 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
57 |
|
|
# GD -> LE with hidden variable defined in executable
|
58 |
|
|
[0-9a-f]+: 48 c7 c0 a0 ff ff ff[ ]+mov \$0xf+a0,%rax
|
59 |
|
|
# sh1
|
60 |
|
|
[0-9a-f]+: 66 90[ ]+xchg %ax,%ax
|
61 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
62 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
63 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
64 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
65 |
|
|
# LD -> LE
|
66 |
|
|
[0-9a-f]+: 48 c7 c0 00 00 00 00[ ]+mov \$0x0,%rax
|
67 |
|
|
[0-9a-f]+: 66 90[ ]+xchg %ax,%ax
|
68 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
69 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
70 |
|
|
[0-9a-f]+: 48 8d 90 81 ff ff ff[ ]+lea -0x7f\(%rax\),%rdx
|
71 |
|
|
# sl1+1
|
72 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
73 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
74 |
|
|
[0-9a-f]+: 4c 8d 88 86 ff ff ff[ ]+lea -0x7a\(%rax\),%r9
|
75 |
|
|
# sl2+2
|
76 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
77 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
78 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
79 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
80 |
|
|
# LD -> LE against hidden variables
|
81 |
|
|
[0-9a-f]+: 48 8d 90 a0 ff ff ff[ ]+lea -0x60\(%rax\),%rdx
|
82 |
|
|
# sh1
|
83 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
84 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
85 |
|
|
[0-9a-f]+: 48 8d 88 a7 ff ff ff[ ]+lea -0x59\(%rax\),%rcx
|
86 |
|
|
# sh2+3
|
87 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
88 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
89 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
90 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
91 |
|
|
# IE against global var
|
92 |
|
|
[0-9a-f]+: 64 4c 8b 0c 25 00 00[ ]+mov %fs:0x0,%r9
|
93 |
|
|
[0-9a-f]+: 00 00 *
|
94 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
95 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
96 |
|
|
[0-9a-f]+: 4c 03 0d de 02 20 00[ ]+add 0x2002de\(%rip\),%r9 +# 601368 <.*>
|
97 |
|
|
# -> R_X86_64_TPOFF64 sG2
|
98 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
99 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
100 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
101 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
102 |
|
|
# IE -> LE against global var defined in exec
|
103 |
|
|
[0-9a-f]+: 64 4c 8b 14 25 00 00[ ]+mov %fs:0x0,%r10
|
104 |
|
|
[0-9a-f]+: 00 00 *
|
105 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
106 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
107 |
|
|
[0-9a-f]+: 4d 8d 92 60 ff ff ff[ ]+lea -0xa0\(%r10\),%r10
|
108 |
|
|
# sg1
|
109 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
110 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
111 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
112 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
113 |
|
|
# IE -> LE against local var
|
114 |
|
|
[0-9a-f]+: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax
|
115 |
|
|
[0-9a-f]+: 00 00 *
|
116 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
117 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
118 |
|
|
[0-9a-f]+: 48 8d 80 80 ff ff ff[ ]+lea -0x80\(%rax\),%rax
|
119 |
|
|
# sl1
|
120 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
121 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
122 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
123 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
124 |
|
|
# IE -> LE against hidden var
|
125 |
|
|
[0-9a-f]+: 64 48 8b 0c 25 00 00[ ]+mov %fs:0x0,%rcx
|
126 |
|
|
[0-9a-f]+: 00 00 *
|
127 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
128 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
129 |
|
|
[0-9a-f]+: 48 8d 89 a0 ff ff ff[ ]+lea -0x60\(%rcx\),%rcx
|
130 |
|
|
# sh1
|
131 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
132 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
133 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
134 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
135 |
|
|
# Direct access through %fs
|
136 |
|
|
# IE against global var
|
137 |
|
|
[0-9a-f]+: 48 8b 0d 89 02 20 00[ ]+mov 0x200289\(%rip\),%rcx +# 601360 <.*>
|
138 |
|
|
# -> R_X86_64_TPOFF64 sG5
|
139 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
140 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
141 |
|
|
[0-9a-f]+: 64 48 8b 11[ ]+mov %fs:\(%rcx\),%rdx
|
142 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
143 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
144 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
145 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
146 |
|
|
# IE->LE against local var
|
147 |
|
|
[0-9a-f]+: 49 c7 c3 90 ff ff ff[ ]+mov \$0xf+90,%r11
|
148 |
|
|
# sl5
|
149 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
150 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
151 |
|
|
[0-9a-f]+: 64 4d 8b 23[ ]+mov %fs:\(%r11\),%r12
|
152 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
153 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
154 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
155 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
156 |
|
|
# IE->LE against hidden var
|
157 |
|
|
[0-9a-f]+: 48 c7 c2 b0 ff ff ff[ ]+mov \$0xf+b0,%rdx
|
158 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
159 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
160 |
|
|
[0-9a-f]+: 64 48 8b 12[ ]+mov %fs:\(%rdx\),%rdx
|
161 |
|
|
# sh5
|
162 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
163 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
164 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
165 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
166 |
|
|
[0-9a-f]+: c9[ ]+leaveq *
|
167 |
|
|
[0-9a-f]+: c3[ ]+retq *
|
168 |
166 |
khays |
[0-9a-f]+: 0f 1f 00[ ]+nopl \(%rax\)
|
169 |
128 |
khays |
|
170 |
|
|
[0-9a-f]+ <_start>:
|
171 |
|
|
[0-9a-f]+: 55[ ]+push %rbp
|
172 |
|
|
[0-9a-f]+: 48 89 e5[ ]+mov %rsp,%rbp
|
173 |
|
|
# IE against global var
|
174 |
|
|
[0-9a-f]+: 64 4c 8b 1c 25 00 00[ ]+mov %fs:0x0,%r11
|
175 |
|
|
[0-9a-f]+: 00 00 *
|
176 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
177 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
178 |
|
|
[0-9a-f]+: 4c 03 1d 52 02 20 00[ ]+add 0x200252\(%rip\),%r11 +# 601370 <.*>
|
179 |
|
|
# -> R_X86_64_TPOFF64 sG6
|
180 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
181 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
182 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
183 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
184 |
|
|
# IE -> LE against global var defined in exec
|
185 |
|
|
[0-9a-f]+: 64 48 8b 14 25 00 00[ ]+mov %fs:0x0,%rdx
|
186 |
|
|
[0-9a-f]+: 00 00 *
|
187 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
188 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
189 |
|
|
[0-9a-f]+: 48 8d 92 d4 ff ff ff[ ]+lea -0x2c\(%rdx\),%rdx
|
190 |
|
|
# bg6
|
191 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
192 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
193 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
194 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
195 |
|
|
# IE -> LE against local var
|
196 |
|
|
[0-9a-f]+: 64 4c 8b 24 25 00 00[ ]+mov %fs:0x0,%r12
|
197 |
|
|
[0-9a-f]+: 00 00 *
|
198 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
199 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
200 |
|
|
[0-9a-f]+: 49 81 c4 f4 ff ff ff[ ]+add \$0xf+f4,%r12
|
201 |
|
|
# bl6
|
202 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
203 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
204 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
205 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
206 |
|
|
# direct %fs access IE -> LE against local var
|
207 |
|
|
[0-9a-f]+: 48 c7 c2 fc ff ff ff[ ]+mov \$0xf+fc,%rdx
|
208 |
|
|
# bl8
|
209 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
210 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
211 |
|
|
[0-9a-f]+: 64 48 8b 02[ ]+mov %fs:\(%rdx\),%rax
|
212 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
213 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
214 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
215 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
216 |
|
|
# IE -> LE against hidden but not local var
|
217 |
|
|
[0-9a-f]+: 64 48 8b 14 25 00 00[ ]+mov %fs:0x0,%rdx
|
218 |
|
|
[0-9a-f]+: 00 00 *
|
219 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
220 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
221 |
|
|
[0-9a-f]+: 48 8d 92 b4 ff ff ff[ ]+lea -0x4c\(%rdx\),%rdx
|
222 |
|
|
# sh6
|
223 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
224 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
225 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
226 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
227 |
|
|
# direct %fs access IE -> LE against hidden but not local var
|
228 |
|
|
[0-9a-f]+: 48 c7 c2 bc ff ff ff[ ]+mov \$0xf+bc,%rdx
|
229 |
|
|
# sh8
|
230 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
231 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
232 |
|
|
[0-9a-f]+: 64 48 8b 02[ ]+mov %fs:\(%rdx\),%rax
|
233 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
234 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
235 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
236 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
237 |
|
|
# LE, global var defined in exec
|
238 |
|
|
[0-9a-f]+: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax
|
239 |
|
|
[0-9a-f]+: 00 00 *
|
240 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
241 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
242 |
|
|
[0-9a-f]+: 48 8d 90 64 ff ff ff[ ]+lea -0x9c\(%rax\),%rdx
|
243 |
|
|
# sg2
|
244 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
245 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
246 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
247 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
248 |
|
|
# LE, local var, non-canonical sequence
|
249 |
|
|
[0-9a-f]+: 49 c7 c1 e6 ff ff ff[ ]+mov \$0xf+e6,%r9
|
250 |
|
|
# bl2+2
|
251 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
252 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
253 |
|
|
[0-9a-f]+: 64 48 8b 14 25 00 00[ ]+mov %fs:0x0,%rdx
|
254 |
|
|
[0-9a-f]+: 00 00 *
|
255 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
256 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
257 |
|
|
[0-9a-f]+: 4c 01 ca[ ]+add %r9,%rdx
|
258 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
259 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
260 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
261 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
262 |
|
|
# LE, hidden var defined in exec, non-canonical sequence
|
263 |
|
|
[0-9a-f]+: 64 48 8b 14 25 00 00[ ]+mov %fs:0x0,%rdx
|
264 |
|
|
[0-9a-f]+: 00 00 *
|
265 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
266 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
267 |
|
|
[0-9a-f]+: 48 81 c2 a5 ff ff ff[ ]+add \$0xf+a5,%rdx
|
268 |
|
|
# sh2+1
|
269 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
270 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
271 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
272 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
273 |
|
|
# Direct %fs access
|
274 |
|
|
# LE, global var defined in exec
|
275 |
|
|
[0-9a-f]+: 64 48 8b 04 25 68 ff[ ]+mov %fs:0xf+68,%rax
|
276 |
|
|
[0-9a-f]+: ff ff *
|
277 |
|
|
# sg3
|
278 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
279 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
280 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
281 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
282 |
|
|
# LE, local var
|
283 |
|
|
[0-9a-f]+: 64 4c 8b 14 25 eb ff[ ]+mov %fs:0xf+eb,%r10
|
284 |
|
|
[0-9a-f]+: ff ff *
|
285 |
|
|
# bl3+3
|
286 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
287 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
288 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
289 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
290 |
|
|
# LE, hidden var defined in exec
|
291 |
|
|
[0-9a-f]+: 64 48 8b 14 25 a9 ff[ ]+mov %fs:0xf+a9,%rdx
|
292 |
|
|
[0-9a-f]+: ff ff *
|
293 |
|
|
# sh3+1
|
294 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
295 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
296 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
297 |
|
|
[0-9a-f]+: 90[ ]+nop *
|
298 |
|
|
# LE, large model
|
299 |
|
|
[0-9a-f]+: 48 ba a5 ff ff ff ff[ ]+movabs \$0xffffffffffffffa5,%rdx
|
300 |
|
|
[0-9a-f]+: ff ff ff *
|
301 |
|
|
[0-9a-f]+: c9[ ]+leaveq *
|
302 |
|
|
[0-9a-f]+: c3[ ]+retq *
|