It is very easy to find the section id table before the grammar for module section layout and assume that they correspond.
The fact that data count appears before code in the binary but has the last section ID is very easy to miss and tooling does not always give intuitive errors.
Recommendation: Add a note right underneath the section ID table saying something like
Note: Section ID does not correspond to section order in the binary. See modules for the ordering.
It is very easy to find the section id table before the grammar for module section layout and assume that they correspond.
The fact that data count appears before code in the binary but has the last section ID is very easy to miss and tooling does not always give intuitive errors.
Recommendation: Add a note right underneath the section ID table saying something like