Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions DynamicLinking.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ relocation types for accessing data and functions address relative to
- `12 / R_WASM_TABLE_INDEX_REL_SLEB` - a function address (table index)
relative to the `__table_base` wasm global. Used in position indepenent code
(`-fPIC`) where absolute function addresses are not known at link time.
- `21 / R_WASM_MEMORY_ADDR_TLS_SLEB` (in LLVM `master`) - an offset from the
`__tls_base` symbol encoded as a 5-byte [varint32]. Used for PIC case to reject
absolute relocation.

All code that gets linked into a WebAssembly dynamic library must be compiled
as position independant. The corresponding absolute reloction types
Expand Down
5 changes: 5 additions & 0 deletions Linking.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ taking the address of a function in a static data initializer.
- `20 / R_WASM_TABLE_NUMBER_LEB` (in LLVM `master`) - a table number encoded as
a 5-byte [varuint32]. Used for the table immediate argument in the table.*
instructions.
- `22 / R_WASM_FUNCTION_OFFSET_I64` (in LLVM `master`) - the 64-bit counterpart
of `R_WASM_FUNCTION_OFFSET_I32`. a byte offset within code section for the
specific function encoded as a [uint64].
- `23 / R_WASM_MEMORY_ADDR_LOCREL_I32` (in LLVM `master`) - an offset between
its relocating address and the symbol address encoded as a [uint32]. Used for pointer-relative addressing.

**Note**: Please note that the 64bit relocations are not yet stable and
therefore, subject to change.
Expand Down