Skip to content

Commit 6f0a5f1

Browse files
committed
Make the example with data relocations more commplex
1 parent a5f894e commit 6f0a5f1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Linking.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -843,10 +843,11 @@ In data segments, relocation annotations can be interleaved into the data
843843
string sequence. When that happens, relocations are situated after the last
844844
byte of the value being relocated.
845845

846-
For example, relocation of a 32-bit function pointer `$foo` into the data
847-
segment of size 4 would look like following:
846+
For example, relocation of a 32-bit function pointer `$foo` and a 32-bit
847+
reference to a data symbol `$bar` into the data segment of size 8 would look
848+
like following:
848849
```wat
849-
(data (i32.const 0) "\00\00\00\00" (@reloc i32 functbl $foo))
850+
(data (i32.const 0) "\00\00\00\00" (@reloc i32 functbl $foo) "\00\00\00\00" (@reloc i32 data $bar))
850851
```
851852

852853
## Symbols

0 commit comments

Comments
 (0)