aboutsummaryrefslogtreecommitdiff
path: root/BinaryEncoding.md
diff options
context:
space:
mode:
authorJF Bastien <github@jfbastien.com>2016-02-25 09:57:58 -0800
committerJF Bastien <github@jfbastien.com>2016-02-25 09:57:58 -0800
commit4bb16aa96fa8d207fede891f6764781095b56bcf (patch)
tree1f04ace67a22f9c710bcecf0231fa4c23b6bfd03 /BinaryEncoding.md
parent8ab07860e873c37f5ee724c7a257349cd6aa318a (diff)
parentf42df8dc1ed183c9178577b451e18ebc37cc314d (diff)
downloadnanowasm-design-4bb16aa96fa8d207fede891f6764781095b56bcf.tar.gz
Merge pull request #547 from WebAssembly/import_table
Add import table.
Diffstat (limited to 'BinaryEncoding.md')
-rw-r--r--BinaryEncoding.md18
1 files changed, 18 insertions, 0 deletions
diff --git a/BinaryEncoding.md b/BinaryEncoding.md
index a416c7a..671e94d 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 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
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.