diff options
| author | titzer <titzer@google.com> | 2016-02-23 08:16:41 -0800 |
|---|---|---|
| committer | titzer <titzer@google.com> | 2016-02-23 08:16:41 -0800 |
| commit | 27cfc727482d52ce8c133a95ac655418ad164812 (patch) | |
| tree | 38d2b24fae08cdc6c45c4a4e4499d7e27018ffd3 /BinaryEncoding.md | |
| parent | 01e8ac76a5d12c8308c3db92242c042ee59f668b (diff) | |
| download | nanowasm-design-27cfc727482d52ce8c133a95ac655418ad164812.tar.gz | |
Add import table.
Diffstat (limited to 'BinaryEncoding.md')
| -rw-r--r-- | BinaryEncoding.md | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/BinaryEncoding.md b/BinaryEncoding.md index bfdbe30..8f6e610 100644 --- a/BinaryEncoding.md +++ b/BinaryEncoding.md @@ -104,6 +104,24 @@ A module may contain at most one signatures section. | return_type | `value_type?` | the return type of the function, with `0` indicating no return type | | param_types | `value_type*` | the parameter types of the function | +### Import table section +The import section declares all imports that will be used in the module. +A module may contain at most one import table section. + +| Field | Type | Description | +| ----- | ----- | ----- | +| id = `0x08` | `uint8` | section identifier for imports | +| count | `varuint32` | count of import entries to follow | +| entries | `import_entry*` | repeated import entries as described below | + +#### Import entry +| Field | Type | Description | +| ----- | ----- | ----- | +| sig_index | `uint16` | signature index of the import | +| module_name | `uint32` | offset of the string representing the module name | +| func_name | `uint32` | offset of the string representing the function name | + + ### Functions section The Functions section declares the functions in the module and must be preceded by a [Signatures](#signatures-section) section. A module may contain at most one functions section. |
