[PATCH] D43264: [WebAssembly] Add explicit symbol table

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 13 16:16:26 PST 2018


sbc100 added a comment.

This is indeed a large change.  I added a little more to the description.

@ncw has been working on these changes as two seperate partss (actual 4 parts, 2 in llvm and 2 on lld).  I decided to merge them into single commit in each repo.

Essentially, for the relocatable output (`llc` output and `lld -r` output) we using an explicit symbol table rather than trying to module the entire thing using wasm's import/export/global concepts.

We get several advantages when doing this:

1. relocations can refer a symbol index (previously we have no symbol index space)
2. Data symbols can have other information such as size (previously we have just a single 32-bit address)
3. Data symbols can specify which segment they live in.  We had we previously having trouble with data symbols that we on the boundy of two segments.  Now we store "segment index + offset".

Some downside:

1. Relocatable output is less readable by standard wasm tools (and browsers).
2. Relocatable and executable output have two different way to export things.

The original bug: https://github.com/WebAssembly/tool-conventions/issues/38


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D43264





More information about the llvm-commits mailing list