-
Notifications
You must be signed in to change notification settings - Fork 16.9k
Expand file tree
/
Copy pathtls-libcall.s
More file actions
74 lines (65 loc) · 1.75 KB
/
tls-libcall.s
File metadata and controls
74 lines (65 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.o %s
# RUN: wasm-ld --libcall-thread-context --shared-memory -no-gc-sections -o %t.wasm %t.o
# RUN: obj2yaml %t.wasm | FileCheck %s
# RUN: llvm-objdump -d --no-print-imm-hex --no-show-raw-insn %t.wasm | FileCheck %s --check-prefix=DIS
.globl __wasm_get_tls_base
__wasm_get_tls_base:
.functype __wasm_get_tls_base () -> (i32)
i32.const 0
end_function
.globl _start
_start:
.functype _start () -> (i32)
call __wasm_get_tls_base
i32.const tls1@TLSREL
i32.add
i32.load 0
call __wasm_get_tls_base
i32.const tls2@TLSREL
i32.add
i32.load 0
i32.add
end_function
.section .tdata.tls1,"",@
.globl tls1
tls1:
.int32 1
.size tls1, 4
.section .tdata.tls2,"",@
.globl tls2
tls2:
.int32 2
.size tls2, 4
.section .custom_section.target_features,"",@
.int8 3
.int8 43
.int8 22
.ascii "libcall-thread-context"
.int8 43
.int8 11
.ascii "bulk-memory"
.int8 43
.int8 7
.ascii "atomics"
# CHECK: GlobalNames:
# CHECK-NEXT: - Index: 0
# CHECK-NEXT: Name: __init_stack_pointer
# CHECK-NEXT: - Index: 1
# CHECK-NEXT: Name: __init_tls_base
# CHECK-NEXT: - Index: 2
# CHECK-NEXT: Name: __tls_size
# CHECK-NEXT: - Index: 3
# CHECK-NEXT: Name: __tls_align
# DIS-LABEL: <__wasm_init_memory>:
# DIS-LABEL: <_start>:
# DIS-EMPTY:
# DIS-NEXT: call 4
# DIS-NEXT: i32.const 0
# DIS-NEXT: i32.add
# DIS-NEXT: i32.load 0
# DIS-NEXT: call 4
# DIS-NEXT: i32.const 4
# DIS-NEXT: i32.add
# DIS-NEXT: i32.load 0
# DIS-NEXT: i32.add
# DIS-NEXT: end