Dumps information about sections in a WebAssembly file.
This is a relatively incomplete subcommand and is generally intended to just
help poke around an object file.
Usage: wasm-tools objdump [OPTIONS] [INPUT]
Arguments:
[INPUT]
Input file to process.
If not provided or if this is `-` then stdin is read entirely and
processed. Note that for most subcommands this input can either be a
binary `*.wasm` file or a textual format `*.wat` file.
Options:
-o, --output <OUTPUT>
Where to place output.
Required when printing WebAssembly binary output.
If not provided, then stdout is used.
-v, --verbose...
Use verbose output (-v info, -vv debug, -vvv trace)
--color <COLOR>
Configuration over whether terminal colors are used in output.
Supports one of `auto|never|always|always-ansi`. The default is to
detect what to do based on the terminal environment, for example by
using `isatty`.
[default: auto]
-h, --help
Print help (see a summary with '-h')
Examples:
# Dump the contents of the file `add.wasm`:
$ wasm-tools objdump add.wasm
types | 0xa - 0x11 |
7 bytes | 1 count
functions | 0x13 - 0x15 |
2 bytes | 1 count
exports | 0x17 - 0x33 |
28 bytes | 1 count
code | 0x35 - 0x3e |
9 bytes | 1 count
custom "name" | 0x45 - 0x5c |
23 bytes | 1 count
One line is printed per section. The columns indicate:
* The name of the section (for example, "types")
* The offsets within the file for the start and end of the section (for
example, "0xa - 0x11")
* The size of the section (for example, "7 bytes")
* The number of items within the section (for example, "1 count")
# Dump the contents of the file `add.wasm` and store the text-based
output in a file
# named `add.txt`:
$ wasm-tools objdump add.wasm -o add.txt
Exit status:
0 if OK,
nonzero to indicate a parse error.