[PATCH] D42080: [WebAssembly] Symbol changes #2: Table relocs, LLVM

Nicholas Wilson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 15 10:48:35 PST 2018


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

Second chunk split out of https://reviews.llvm.org/D41954.

Must be committed simultaneously with LLD change, DXXX.

Changes:

- Change the binary format for table relocations. Formerly, if you wanted to reloc against function "2", you'd put "2" in the table, then put the table index in the relocation. Now, you just put "2" in the relocation. For Clang output (or relocatable LLD output) the actual table is completely ignored - the relocation specifies which function.
- Test expectations are updated accordingly. The new relocation values should match the old values from the ELEM section.
- I haven't changed anything about the ELEM section itself. It's now unused, and has the same value it always has. This can freely changed in a future commit, since it now does nothing. (The next commit will change it, so that "relocatable" and non-relocatable Wasm objects have identical ELEM section. There's no need at all for the current artificial differences, so for the dummy values the Clang outputs there, we may as well write out the same values that LLD would.)


Repository:
  rL LLVM

https://reviews.llvm.org/D42080

Files:
  lib/MC/WasmObjectWriter.cpp
  test/MC/WebAssembly/func-address.ll
  test/MC/WebAssembly/global-ctor-dtor.ll
  test/MC/WebAssembly/weak-alias.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42080.129883.patch
Type: text/x-patch
Size: 5997 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180115/c71d4ea7/attachment.bin>


More information about the llvm-commits mailing list