[PATCH] D41954: [WebAssembly] Refactor symbol index handling (LLVM)

Nicholas Wilson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 11 10:45:08 PST 2018


ncw created this revision.
Herald added subscribers: llvm-commits, sunfish, aheejin, jgravelle-google, sbc100, dschuff, jfb.

WORK IN PROGRESS

Changes:

- Revert the revert on index handling - so now we're back where we were in November in terms of each MCSymbol being represented in the Wasm by a single Import or Export (and not one of each for weak symbols!)
- Rejig the index handling so that we're explicit throughout about which indexes we're using (ie rename variables from `Index` to `SymbolIndex` etc).
- Track both "symbol index" and "Wasm index" for each entity. A Wasm function can have more than one symbol attached - so get rid of the indexing confusion
- Document new scheme in the headers
- Change the way table index relocations are computed; now the relocation's value is the symbol index, not the index in the table, so it's easier for LLD to construct the correct table
- Don't include discarded functions in the table in LLD
- Change the sym-info linking metadata to refer to symbols by index rather than by string (reduce filesize for Wasm object files)


Repository:
  rL LLVM

https://reviews.llvm.org/D41954

Files:
  include/llvm/BinaryFormat/Wasm.h
  include/llvm/Object/Wasm.h
  include/llvm/ObjectYAML/WasmYAML.h
  lib/MC/WasmObjectWriter.cpp
  lib/Object/WasmObjectFile.cpp
  lib/ObjectYAML/WasmYAML.cpp
  test/MC/WebAssembly/weak-alias.ll
  test/ObjectYAML/wasm/linking_section.yaml
  test/ObjectYAML/wasm/weak_symbols.yaml
  test/tools/llvm-nm/wasm/weak-symbols.yaml
  test/tools/llvm-objdump/WebAssembly/symbol-table.test
  test/tools/llvm-readobj/symbols.test
  tools/llvm-readobj/WasmDumper.cpp
  tools/obj2yaml/wasm2yaml.cpp
  tools/yaml2obj/yaml2wasm.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41954.129478.patch
Type: text/x-patch
Size: 54118 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180111/920ba637/attachment.bin>


More information about the llvm-commits mailing list