Skip to content
Merged
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
30 changes: 15 additions & 15 deletions BinaryEncoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ The content of each section is encoded in its `payload_str`.
* [Global](#global-section) section
* [Export](#export-section) section
* [Start](#start-section) section
* [Code](#code-section) section
* [Element](#element-section) section
* [Code](#code-section) section
* [Data](#data-section) section
* [Name](#name-section) section

Expand Down Expand Up @@ -309,20 +309,6 @@ The start section declares the [start function](Modules.md#module-start-function
| ----- | ---- | ----------- |
| index | `varuint32` | start function index |

### Code section

ID: `code`

The code section contains a body for every function in the module.
The count of function declared in the [function section](#function-section)
and function bodies defined in this section must be the same and the `i`th
declaration corresponds to the `i`th function body.

| Field | Type | Description |
| ----- | ---- | ----------- |
| count | `varuint32` | count of function bodies to follow |
| bodies | `function_body*` | sequence of [Function Bodies](#function-bodies) |

### Element section

ID: `elem`
Expand All @@ -343,6 +329,20 @@ a `elem_segment` is:
| num_elem | `varuint32` | number of elements to follow |
| elems | `varuint32*` | sequence of [function indices](Modules.md#function-index-space) |

### Code section

ID: `code`

The code section contains a body for every function in the module.
The count of function declared in the [function section](#function-section)
and function bodies defined in this section must be the same and the `i`th
declaration corresponds to the `i`th function body.

| Field | Type | Description |
| ----- | ---- | ----------- |
| count | `varuint32` | count of function bodies to follow |
| bodies | `function_body*` | sequence of [Function Bodies](#function-bodies) |

### Data section

ID: `data`
Expand Down