aboutsummaryrefslogtreecommitdiff
path: root/bfd/doc/webassembly.texi
diff options
context:
space:
mode:
authorPip Cet <pipcet@gmail.com>2017-03-27 13:41:39 +0100
committerNick Clifton <nickc@redhat.com>2017-03-27 13:41:39 +0100
commita6be053897be3786ceda9a59d17befe11454f6d2 (patch)
tree376ce48fd695807471d9275ce3272253f31918e8 /bfd/doc/webassembly.texi
parent210477268d4ac5cad937e811888a5c932206794c (diff)
downloadgdb-a6be053897be3786ceda9a59d17befe11454f6d2.zip
gdb-a6be053897be3786ceda9a59d17befe11454f6d2.tar.gz
gdb-a6be053897be3786ceda9a59d17befe11454f6d2.tar.bz2
Add support for the WebAssembly backend to the BFD library.
* wasm-module.c: New file to support WebAssembly modules. * wasm-module.h: New file to support WebAssembly modules. * doc/webassembly.texi: Start documenting wasm-module.c. * config.bfd: Add wasm_vec. * targets.c: Likewise. * configure.ac: Likewise. * Makefile.am: Add entries for wasm-module.c. * Makefile.in: Regenerate. * configure: Regenerate. * po/SRC-POTFILES.in: Regenerate.
Diffstat (limited to 'bfd/doc/webassembly.texi')
-rw-r--r--bfd/doc/webassembly.texi33
1 files changed, 33 insertions, 0 deletions
diff --git a/bfd/doc/webassembly.texi b/bfd/doc/webassembly.texi
new file mode 100644
index 0000000..ad65094
--- /dev/null
+++ b/bfd/doc/webassembly.texi
@@ -0,0 +1,33 @@
+@section WebAssembly backend
+The WebAssembly module file format, at present, is a very simple
+object file format with up to 11 numbered sections plus named
+``custom'' sections. At present, there is no standard for relocations
+or symbols, though a @code{"name"} subsection can assign names to
+function indices and local variables.
+
+As such, it offers no real advantages over ELF, and intermediate ELF
+files can be used to produce WebAssembly modules. The WebAssembly
+backend aims to enable the opposite: reading a WebAssembly module and
+producing an ELF file containing the same information, which can then
+be manipulated and inspected with standard tools.
+
+When writing WebAssembly modules, the WebAssembly backend attempts to
+determine based on the section name whether to use a numeric section
+id, a named section header, or to include the section verbatim,
+assuming it already contains any necessary header.
+
+Function names are supported as symbols; local names and WebAssembly
+relocation sections are currently unsupported.
+
+There are slight differences in the LEB128 integer implementations
+between the WebAssembly specification and the BFD code; these result
+in some malformed WebAssembly modules being treated as valid.
+
+@menu
+* File layout::
+@end menu
+
+@node File layout, WebAssembly
+@subsection File layout
+For a description of the WebAssembly file format, see
+@url{https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md}.