[WebAssembly] Add first claass symbol table to wasm objects
authorSam Clegg <sbc@chromium.org>
Fri, 23 Feb 2018 05:08:34 +0000 (05:08 +0000)
committerSam Clegg <sbc@chromium.org>
Fri, 23 Feb 2018 05:08:34 +0000 (05:08 +0000)
commit6c899ba6dee1a6cd1e1a49900bb5f3b6353a5487
tree565c8241b9b4a62f0ae1a227d26b4d8f1bbd1023
parent0fd6a530a0b61501ad0da1177e2e4c9dbf138a74
[WebAssembly] Add first claass symbol table to wasm objects

This is combination of two patches by Nicholas Wilson:
  1. https://reviews.llvm.org/D41954
  2. https://reviews.llvm.org/D42495

Along with a few local modifications:
- One change I made was to add the UNDEFINED bit to the binary format
  to avoid the extra byte used when writing data symbols.  Although this
  bit is redundant for other symbols types (i.e. undefined can be
  implied if a function or global is a wasm import)
- I prefer to be explicit and consistent and not have derived flags.
- Some field renaming.
- Some reverting of unrelated minor changes.
- No test output differences.

Differential Revision: https://reviews.llvm.org/D43147

llvm-svn: 325860
43 files changed:
llvm/include/llvm/BinaryFormat/Wasm.h
llvm/include/llvm/MC/MCSectionWasm.h
llvm/include/llvm/MC/MCSymbolWasm.h
llvm/include/llvm/Object/Wasm.h
llvm/include/llvm/ObjectYAML/WasmYAML.h
llvm/lib/MC/MCWasmStreamer.cpp
llvm/lib/MC/WasmObjectWriter.cpp
llvm/lib/Object/WasmObjectFile.cpp
llvm/lib/ObjectYAML/WasmYAML.cpp
llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.cpp
llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
llvm/test/MC/WebAssembly/array-fill.ll
llvm/test/MC/WebAssembly/bss.ll
llvm/test/MC/WebAssembly/comdat.ll
llvm/test/MC/WebAssembly/explicit-sections.ll
llvm/test/MC/WebAssembly/func-address.ll
llvm/test/MC/WebAssembly/global-ctor-dtor.ll
llvm/test/MC/WebAssembly/reloc-code.ll
llvm/test/MC/WebAssembly/reloc-data.ll
llvm/test/MC/WebAssembly/sections.ll
llvm/test/MC/WebAssembly/unnamed-data.ll
llvm/test/MC/WebAssembly/visibility.ll
llvm/test/MC/WebAssembly/weak-alias.ll
llvm/test/MC/WebAssembly/weak.ll
llvm/test/Object/Inputs/trivial-object-test.wasm
llvm/test/Object/nm-trivial-object.test
llvm/test/Object/obj2yaml.test
llvm/test/Object/objdump-relocations.test
llvm/test/ObjectYAML/wasm/linking_section.yaml
llvm/test/ObjectYAML/wasm/weak_symbols.yaml
llvm/test/tools/llvm-nm/wasm/exports.yaml
llvm/test/tools/llvm-nm/wasm/imports.yaml
llvm/test/tools/llvm-nm/wasm/weak-symbols.yaml
llvm/test/tools/llvm-objdump/Inputs/trivial.obj.wasm
llvm/test/tools/llvm-objdump/WebAssembly/symbol-table.test
llvm/test/tools/llvm-objdump/wasm.txt
llvm/test/tools/llvm-readobj/Inputs/trivial.obj.wasm
llvm/test/tools/llvm-readobj/relocations.test
llvm/test/tools/llvm-readobj/sections.test
llvm/test/tools/llvm-readobj/symbols.test
llvm/tools/llvm-readobj/WasmDumper.cpp
llvm/tools/obj2yaml/wasm2yaml.cpp
llvm/tools/yaml2obj/yaml2wasm.cpp