blob: 088d6163d6b0bbf26968d756d1bca6dfe8e68310 (
plain)
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
|
# clang -target wasm32 -nostdlib -Wl,--no-entry -Wl,--export-all -O0 -g -o simple.wasm simple.c
# char* str = "data str";
#
# int add(int a, int b) {
# return a + b;
# }
#
# int main() {
# int i = 1;
# int j = 2;
# return add(i, j);
# }
--- !WASM
FileHeader:
Version: 0x1
Sections:
- Type: TYPE
Signatures:
- Index: 0
ParamTypes: []
ReturnTypes: []
- Index: 1
ParamTypes:
- I32
- I32
ReturnTypes:
- I32
- Index: 2
ParamTypes: []
ReturnTypes:
- I32
- Type: FUNCTION
FunctionTypes: [ 0, 1, 2, 1 ]
- Type: TABLE
Tables:
- Index: 0
ElemType: FUNCREF
Limits:
Flags: [ HAS_MAX ]
Minimum: 0x1
Maximum: 0x1
- Type: MEMORY
Memories:
- Minimum: 0x2
- Type: GLOBAL
Globals:
- Index: 0
Type: I32
Mutable: true
InitExpr:
Opcode: I32_CONST
Value: 66576
- Index: 1
Type: I32
Mutable: false
InitExpr:
Opcode: I32_CONST
Value: 1036
- Index: 2
Type: I32
Mutable: false
InitExpr:
Opcode: I32_CONST
Value: 1024
- Index: 3
Type: I32
Mutable: false
InitExpr:
Opcode: I32_CONST
Value: 1040
- Index: 4
Type: I32
Mutable: false
InitExpr:
Opcode: I32_CONST
Value: 1040
- Index: 5
Type: I32
Mutable: false
InitExpr:
Opcode: I32_CONST
Value: 66576
- Index: 6
Type: I32
Mutable: false
InitExpr:
Opcode: I32_CONST
Value: 1024
- Index: 7
Type: I32
Mutable: false
InitExpr:
Opcode: I32_CONST
Value: 66576
- Index: 8
Type: I32
Mutable: false
InitExpr:
Opcode: I32_CONST
Value: 131072
- Index: 9
Type: I32
Mutable: false
InitExpr:
Opcode: I32_CONST
Value: 0
- Index: 10
Type: I32
Mutable: false
InitExpr:
Opcode: I32_CONST
Value: 1
- Index: 11
Type: I32
Mutable: false
InitExpr:
Opcode: I32_CONST
Value: 65536
- Type: EXPORT
Exports:
- Name: memory
Kind: MEMORY
Index: 0
- Name: __wasm_call_ctors
Kind: FUNCTION
Index: 0
- Name: add
Kind: FUNCTION
Index: 1
- Name: __original_main
Kind: FUNCTION
Index: 2
- Name: main
Kind: FUNCTION
Index: 3
- Name: str
Kind: GLOBAL
Index: 1
- Name: __main_void
Kind: FUNCTION
Index: 2
- Name: __indirect_function_table
Kind: TABLE
Index: 0
- Name: __dso_handle
Kind: GLOBAL
Index: 2
- Name: __data_end
Kind: GLOBAL
Index: 3
- Name: __stack_low
Kind: GLOBAL
Index: 4
- Name: __stack_high
Kind: GLOBAL
Index: 5
- Name: __global_base
Kind: GLOBAL
Index: 6
- Name: __heap_base
Kind: GLOBAL
Index: 7
- Name: __heap_end
Kind: GLOBAL
Index: 8
- Name: __memory_base
Kind: GLOBAL
Index: 9
- Name: __table_base
Kind: GLOBAL
Index: 10
- Name: __wasm_first_page_end
Kind: GLOBAL
Index: 11
- Type: CODE
Functions:
- Index: 0
Locals: []
Body: 0B
- Index: 1
Locals:
- Type: I32
Count: 1
Body: 23808080800041106B21022002200036020C20022001360208200228020C20022802086A0F0B
- Index: 2
Locals:
- Type: I32
Count: 2
Body: 23808080800041106B210020002480808080002000410036020C2000410136020820004102360204200028020820002802041081808080002101200041106A24808080800020010F0B
- Index: 3
Locals: []
Body: 1082808080000F0B
- Type: DATA
Segments:
- SectionOffset: 7
InitFlags: 0
Offset:
Opcode: I32_CONST
Value: 1024
Content: '646174612073747200'
- SectionOffset: 22
InitFlags: 0
Offset:
Opcode: I32_CONST
Value: 1036
Content: '00040000'
- Type: CUSTOM
Name: name
FunctionNames:
- Index: 0
Name: __wasm_call_ctors
- Index: 1
Name: add
- Index: 2
Name: __original_main
- Index: 3
Name: main
GlobalNames:
- Index: 0
Name: __stack_pointer
DataSegmentNames:
- Index: 0
Name: .rodata
- Index: 1
Name: .data
- Type: CUSTOM
HeaderSecSizeEncodingLen: 2
Name: producers
Languages:
- Name: C11
Version: ''
Tools:
- Name: clang
Version: '22.0.0git'
- Type: CUSTOM
Name: target_features
Features:
- Prefix: USED
Name: bulk-memory
- Prefix: USED
Name: bulk-memory-opt
- Prefix: USED
Name: call-indirect-overlong
- Prefix: USED
Name: multivalue
- Prefix: USED
Name: mutable-globals
- Prefix: USED
Name: nontrapping-fptoint
- Prefix: USED
Name: reference-types
- Prefix: USED
Name: sign-ext
...
|