Files
releases/internal/wasm/module
Stephan Renatus 44bdd10e5c wasm: (explicitly) export only what should be (#3061)
* wasm: build without --export-all, annotate exports and "used" functions

This introduces three #define statements,

- WASM_EXPORT(name)
- OPA_BUILTIN
- OPA_INTERNAL

The first one makes LLVM _export_ a function (by the passed name), the
latter two make LLVM keep them, so they're not removed when it's deleting
dead code.

Under the hood, there is no distinction between OPA_BUILTIN and
OPA_INTERNAL. OPA_BUILTIN is used for functions that are the;
implementation of a builtin; OPA_INTERNAL is used for functions that
the planner generates calls to (i.e., parts implemented in C, but not
directly corresponding to builtins).

* wasm: read func indices from name section

The Name section (a custom section) includes imports, exports, and
the names of "ordinary" functions.

Since we no longer export everything, it allows us to map names to
func indices.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
2021-01-14 17:24:45 +01:00
..