From 27cfc727482d52ce8c133a95ac655418ad164812 Mon Sep 17 00:00:00 2001 From: titzer Date: Tue, 23 Feb 2016 08:16:41 -0800 Subject: Add import table. --- BinaryEncoding.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'BinaryEncoding.md') 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. -- cgit v1.2.3 From f42df8dc1ed183c9178577b451e18ebc37cc314d Mon Sep 17 00:00:00 2001 From: titzer Date: Thu, 25 Feb 2016 09:43:53 -0800 Subject: Update text: "offset from start of the module" --- BinaryEncoding.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'BinaryEncoding.md') diff --git a/BinaryEncoding.md b/BinaryEncoding.md index 8f6e610..90f7830 100644 --- a/BinaryEncoding.md +++ b/BinaryEncoding.md @@ -118,8 +118,8 @@ A module may contain at most one import table section. | 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 | +| module_name | `uint32` | offset from the start of the module of the string representing the module name | +| func_name | `uint32` | offset from the start of the module of the string representing the function name | ### Functions section -- cgit v1.2.3