Skip to content

Commit e314caf

Browse files
committed
Fix typos
1 parent e505cb0 commit e314caf

File tree

1 file changed

+46
-40
lines changed

1 file changed

+46
-40
lines changed

Linking.md

Lines changed: 46 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -752,8 +752,8 @@ Relocations are represented as WebAssembly annotations of the form
752752
|`i64` | `R_WASM_*_I64` | 8-byte [uint64] |
753753
|`leb` | `R_WASM_*_LEB` | 5-byte [varuint32] |
754754
|`sleb` | `R_WASM_*_SLEB` | 5-byte [varint32] |
755-
|`leb64` | `R_WASM_*_LEB` | 10-byte [varuint64] |
756-
|`sleb64` | `R_WASM_*_SLEB` | 10-byte [varint64] |
755+
|`leb64` | `R_WASM_*_LEB64` | 10-byte [varuint64] |
756+
|`sleb64` | `R_WASM_*_SLEB64` | 10-byte [varint64] |
757757

758758
- `method` describes the type of relocation, so what kind of symbol we are relocating against and how to interpret that symbol.
759759

@@ -790,10 +790,10 @@ Symbol kinds marked with `*` are considered *primary*.
790790
| `<labeluse>` | Byte offest to label | `method` allows addend and `method` is either `text` or `section` |
791791

792792
- `symbol` describes the symbol against which to perform relocation.
793-
- For `funcsec` relocation metod, this is the function id, so that if the addend is zero, the relocation points to the first instruction of that function.
794-
- For `datasec` relocation metod, this is the data segment id, so that if the addend is zero, the relocation points to the first byte of data in that segment.
795-
- For `customsec` relocation metod, this is the name of the custom section, so that if the addend is zero, the relocation points to the first byte of data in that segment.
796-
- For other relocation metods, this denotes the symbol in the scope of that symbol kind.
793+
- For `funcsec` relocation method, this is the function id, so that if the addend is zero, the relocation points to the first instruction of that function.
794+
- For `datasec` relocation method, this is the data segment id, so that if the addend is zero, the relocation points to the first byte of data in that segment.
795+
- For `customsec` relocation method, this is the name of the custom section, so that if the addend is zero, the relocation points to the first byte of data in that segment.
796+
- For other relocation methods, this denotes the symbol in the scope of that symbol kind.
797797

798798
The relocation type is looked up from the combination of `format`, `method`, and `modifier`. If no relocation type exists, an error is raised.
799799

@@ -807,11 +807,11 @@ If all components of a relocation annotation are skipped, the annotation may be
807807

808808
### Instruction relocations
809809

810-
For every usage of an `typeidx`, `funcidx`, `globalidx`, `tagidx`, a relocation annotation is added afterwards, with `format` predefined as `leb`, `method` predefined as the *primary* method for that type, and `symbol` defaulted as the *primary* symbol of that `idx`
810+
For every usage of `typeidx`, `funcidx`, `globalidx`, `tagidx`, a relocation annotation is added afterwards, with `format` predefined as `leb`, `method` predefined as the *primary* method for that type, and `symbol` defaulted as the *primary* symbol of that `idx`
811811

812-
For the `i32.const` instruction, a relocation annotation is added after the integer literal operand, with `format` predefined as `sleb`, and `method` is allowed to be either `data` or `functable`.
813-
For the `i64.const` instruction, a relocation annotation is added after the integer literal operand, with `format` predefined as `sleb64`, and `method` is allowed to be either `data` or `functable`.
814-
For the `i{32,64}.{load,store}*` instructions, a relocation annotation is added after the offset operand, with `format` predefined as `leb` if the *memory* being referenced is 32-bit, and `leb64` otherwise, and `method` predefined as `data`.
812+
- For the `i32.const` instruction, a relocation annotation is added after the integer literal operand, with `format` predefined as `sleb`, and `method` is allowed to be either `data` or `functable`.
813+
- For the `i64.const` instruction, a relocation annotation is added after the integer literal operand, with `format` predefined as `sleb64`, and `method` is allowed to be either `data` or `functable`.
814+
- For the `i{32,64}.{load,store}*` instructions, a relocation annotation is added after the offset operand, with `format` predefined as `leb` if the *memory* being referenced is 32-bit, and `leb64` otherwise, and `method` predefined as `data`.
815815

816816
### Data relocations
817817

@@ -838,29 +838,29 @@ Data imports represented as WebAssembly annotations of the form
838838

839839
- `qualifier` is one of the allowed qualifiers on a symbol declaration. Qualifiers may not repeat.
840840

841-
| `<qualifier>` | effect |
842-
|------------------|----------------------------------------------------------------------------------|
843-
| `weak` | sets `WASM_SYM_BINDING_WEAK` symbol flag |
844-
| `static` | sets `WASM_SYM_BINDING_LOCAL` symbol flag |
845-
| `hidden` | sets `WASM_SYM_VISIBILITY_HIDDEN` symbol flag |
846-
| `retain` | sets `WASM_SYM_NO_STRIP` symbol flag |
847-
| `thread_local` | sets `WASM_SYM_TLS` symbol flag |
848-
| `size=<int>` | sets symbol's `size` appropriately |
849-
| `offset=<int>` | sets `WASM_SYM_ABSOLUTE` symbol flag, sets symbol's `offset` appropriately |
850-
| `name=<string>` | sets `WASM_SYM_EXPLICIT_NAME` symbol flag, sets `name_len`, `name_data` |
851-
| `priority=<int>` | adds symbol to `WASM_INIT_FUNCS` section with the given priority |
852-
| `comdat=<id>` | adds symbol to a `comdat` with the given id |
853-
854-
`priority` qualifier may only be applied to function symbols.
855-
`size` and `offset` qualifiers may only be applied to data symbols.
856-
`size` and `name` qualifiers must be applied to data symbols.
857-
`name` qualifier must be applied to data imports.
841+
| `<qualifier>` | effect |
842+
|------------------|------------------------------------------------------------------------------------------------|
843+
| `weak` | sets `WASM_SYM_BINDING_WEAK` symbol flag |
844+
| `static` | sets `WASM_SYM_BINDING_LOCAL` symbol flag |
845+
| `hidden` | sets `WASM_SYM_VISIBILITY_HIDDEN` symbol flag |
846+
| `retain` | sets `WASM_SYM_NO_STRIP` symbol flag |
847+
| `thread_local` | sets `WASM_SYM_TLS` symbol flag |
848+
| `size=<int>` | sets symbol's `size` appropriately |
849+
| `offset=<int>` | sets `WASM_SYM_ABSOLUTE` symbol flag, sets symbol's `offset` appropriately |
850+
| `name=<string>` | sets `WASM_SYM_EXPLICIT_NAME` symbol flag, sets symbol's `name_len`, `name_data` appropriately |
851+
| `priority=<int>` | adds symbol to `WASM_INIT_FUNCS` section with the given priority |
852+
| `comdat=<id>` | adds symbol to a `comdat` with the given id |
853+
854+
- The `priority` qualifier may only be applied to function symbols.
855+
- The `size` and `offset` qualifiers may only be applied to data symbols.
856+
- The `size` and `name` qualifiers must be applied to data symbols.
857+
- The `name` qualifier must be applied to data imports.
858858

859859
If all components of a symbol annotation are skipped, the annotation may be omitted.
860860

861861
### WebAssembly object symbols
862862

863-
For symbols related to WebAssembly objects, the sequence of symbol annotation occurs after the optional `id` of the declaration.
863+
For symbols related to WebAssembly objects, the symbol annotation sequence occurs after the optional `id` of the declaration.
864864
For example, the following code:
865865
```wat
866866
(import "env" "foo" (func (@sym $a retain name="a") (@sym $b hidden name="b") (param) (result)))
@@ -870,7 +870,7 @@ declares 3 symbols: one primary symbol with the name of the index of the functio
870870
### Data symbols
871871

872872
Data symbol annotations can be interleaved into the data string sequence. When that happens, relocations are situated before the first byte of the value being defined.
873-
For example, declaration of a 32-bit global by with the name `$foo` and linkage name "foo" would look like following:
873+
For example, a declaration of a 32-bit global with the name `$foo` and linkage name "foo" would look like following:
874874
```wat
875875
(data (i32.const 0) (@sym $foo name="foo" size=4) "\00\00\00\00")
876876
```
@@ -891,22 +891,28 @@ COMDAT declarations occur in the same place as module fields.
891891

892892
## Labels
893893

894-
For some relocation types, an offset into a section/function is necessary. For these cases, lablels exsist.
894+
For some relocation types, an offset into a section/function is necessary. For these cases, labels exsist.
895895
Labels are represented as WebAssembly annotations of the form
896896
```wat
897897
(@sym.label <id>)
898898
```
899899

900900
### Function labels
901-
Function labels occur in the same place as instructions. A label always denotes the first byte of the next instruction, or the byte after end of function's instruction stream if there isn't a next instruction
901+
Function labels occur in the same place as instructions.
902+
A label always denotes the first byte of the next instruction, or the byte after the end of the function's instruction stream, if there isn't a next instruction.
903+
902904
Function label names are local to the function in which they occur.
903905

904906
### Data labels
905-
Data labels can be interleaved into the data string sequence. When that happens, relocations are situated after the last byte of the value being relocated.
907+
Data labels can be interleaved into the data string sequence.
908+
When that happens, relocations are situated after the last byte of the value being relocated.
909+
906910
Data label names are local to the data segment in which they occur.
907911

908912
### Custom labels
909-
Custom labels can be interleaved into the data string sequence. When that happens, relocations are situated after the last byte of the value being relocated.
913+
Custom labels can be interleaved into the data string sequence.
914+
When that happens, relocations are situated after the last byte of the value being relocated.
915+
910916
Custom label names are local to the custom section in which they occur.
911917

912918
## Data segment flags
@@ -917,13 +923,13 @@ Data segment flags are represented as WebAssembly annotations of the form
917923

918924
- `qualifier` is one of the allowed qualifiers on a data segment declaration. Qualifiers may not repeat.
919925

920-
| `<qualifier>` | effect |
921-
|-----------------|-----------------------------------------------|
922-
| `align=<int>` | sets segment's `alignment` appropriately |
923-
| `name=<string>` | sets `name_len`, `name_data` |
924-
| `strings` | sets `WASM_SEGMENT_FLAG_STRINGS` segment flag |
925-
| `thread_local` | sets `WASM_SEGMENT_FLAG_TLS` segment flag |
926-
| `retain` | sets `WASM_SEG_FLAG_RETAIN` segment flag |
926+
| `<qualifier>` | effect |
927+
|-----------------|------------------------------------------------------|
928+
| `align=<int>` | sets segment's `alignment` appropriately |
929+
| `name=<string>` | sets segment's `name_len`, `name_data` appropriately |
930+
| `strings` | sets `WASM_SEGMENT_FLAG_STRINGS` segment flag |
931+
| `thread_local` | sets `WASM_SEGMENT_FLAG_TLS` segment flag |
932+
| `retain` | sets `WASM_SEG_FLAG_RETAIN` segment flag |
927933

928934
If `align` is not specified, it is given a default value of 1.
929935
If `name` is not specified, it is given an empty default value.

0 commit comments

Comments
 (0)