You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Linking.md
+15-3Lines changed: 15 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -127,16 +127,27 @@ of `R_WASM_MEMORY_ADDR_SLEB`. A 64-bit linear memory index encoded as a 10-byte
127
127
-`16 / R_WASM_MEMORY_ADDR_I64` (since LLVM 11.0) - the 64-bit counterpart of
128
128
`R_WASM_MEMORY_ADDR`. A 64-bit linear memory index encoded as a [uint64], e.g.
129
129
taking the 64-bit address of a C++ global in a static data initializer.
130
-
-`18 / R_WASM_TABLE_INDEX_SLEB64` (in LLVM `master`) - the 64-bit counterpart
130
+
-`18 / R_WASM_TABLE_INDEX_SLEB64` (in LLVM 12.0) - the 64-bit counterpart
131
131
of `R_WASM_TABLE_INDEX_SLEB`. A function table index encoded as a 10-byte
132
132
[varint64]. Used to refer to the immediate argument of a `i64.const`
133
133
instruction, e.g. taking the address of a function in Wasm64.
134
-
-`19 / R_WASM_TABLE_INDEX_I64` (in LLVM `master`) - the 64-bit counterpart of
134
+
-`19 / R_WASM_TABLE_INDEX_I64` (in LLVM 12.0) - the 64-bit counterpart of
135
135
`R_WASM_TABLE_INDEX_I32`. A function table index encoded as a [uint64], e.g.
136
136
taking the address of a function in a static data initializer.
137
-
-`20 / R_WASM_TABLE_NUMBER_LEB` (in LLVM `master`) - a table number encoded as
137
+
-`20 / R_WASM_TABLE_NUMBER_LEB` (in LLVM 12.0) - a table number encoded as
138
138
a 5-byte [varuint32]. Used for the table immediate argument in the table.*
139
139
instructions.
140
+
-`22 / R_WASM_FUNCTION_OFFSET_I64` (in LLVM 12.0) - the 64-bit counterpart
141
+
of `R_WASM_FUNCTION_OFFSET_I32`. A byte offset within code section for the
142
+
specific function encoded as a [uint64].
143
+
-`23 / R_WASM_MEMORY_ADDR_LOCREL_I32` (in LLVM 13.0) - a byte offset between
144
+
the relocating address and a linear memory index encoded as a [uint32]. Used
145
+
for pointer-relative addressing.
146
+
-`24 / R_WASM_TABLE_INDEX_REL_SLEB64` (in LLVM 13.0) - the 64-bit counterpart
147
+
of `R_WASM_TABLE_INDEX_REL_SLEB`. A function table index encoded as a 10-byte
148
+
[varint64].
149
+
-`26 / R_WASM_FUNCTION_INDEX_I32` (in LLVM 17.0) - a function index encoded as
150
+
a [uint32]. Used in custom sections for function annotations (`__attribute__((annotate(<name>)))`).
140
151
141
152
**Note**: Please note that the 64bit relocations are not yet stable and
142
153
therefore, subject to change.
@@ -233,6 +244,7 @@ where a `segment` is encoded as:
233
244
The current set of valid flag for segments are:
234
245
-`1 / WASM_SEGMENT_FLAG_STRINGS` - Signals that the segment contains only null terminated strings allowing the linker to perform merging.
235
246
-`2 / WASM_SEGMENT_FLAG_TLS` - The segment contains thread-local data. This means that a unique copy of this segment will be created for each thread.
247
+
-`4 / WASM_SEG_FLAG_RETAIN` - If the object file is included in the final link, the segment should be retained in the final output regardless of whether it is used by the program.
236
248
237
249
For `WASM_INIT_FUNCS` the following fields are present in the
0 commit comments