aboutsummaryrefslogtreecommitdiff
path: root/BinaryEncoding.md
diff options
context:
space:
mode:
authorJF Bastien <github@jfbastien.com>2016-11-04 11:50:21 -0700
committerGitHub <noreply@github.com>2016-11-04 11:50:21 -0700
commit3b2f136b595bb249640c4b7f777840c2de73f3ac (patch)
tree90016e1eea798bd5dbd205e23361dbc097898c7c /BinaryEncoding.md
parent6818f80bd79355eab982f6d52d1da2610738e9d2 (diff)
downloadnanowasm-design-3b2f136b595bb249640c4b7f777840c2de73f3ac.tar.gz
Unknown sections must be uniquely named (#855)
* Unknown sections must be uniquely named This is left unspecified. Unique naming seems like the right answer. * Non-unique * Update name section
Diffstat (limited to 'BinaryEncoding.md')
-rw-r--r--BinaryEncoding.md4
1 files changed, 3 insertions, 1 deletions
diff --git a/BinaryEncoding.md b/BinaryEncoding.md
index e242b0d..2c03c85 100644
--- a/BinaryEncoding.md
+++ b/BinaryEncoding.md
@@ -192,7 +192,8 @@ invalidate a module.
| name | `bytes` ? | section name string, present if `id == 0` |
| payload_data | `bytes` | content of this section, of length `payload_len - sizeof(name) - sizeof(name_len)` |
-Each section is optional and may appear at most once.
+Each known section is optional and may appear at most once.
+Unknown sections all have the same `id`, and can be named non-uniquely (all bytes composing their names can be identical).
Known sections from this list may not appear out of order.
The content of each section is encoded in its `payload_data`.
@@ -417,6 +418,7 @@ User-defined section string: `"name"`
The names section does not change execution semantics, and thus is not allocated a section code.
It is encoded as an unknown section (id `0`) followed by the identification string `"name"`.
Like all unknown sections, a validation error in this section does not cause validation of the module to fail.
+The name section may appear only once, and only after the [Data section](#Data-section).
The expectation is that, when a binary WebAssembly module is viewed in a browser or other development
environment, the names in this section will be used as the names of functions
and locals in the [text format](TextFormat.md).