[WebAssembly] Verify contents of relocation target before writing it
authorSam Clegg <sbc@chromium.org>
Mon, 12 Mar 2018 19:54:26 +0000 (19:54 +0000)
committerSam Clegg <sbc@chromium.org>
Mon, 12 Mar 2018 19:54:26 +0000 (19:54 +0000)
commitdbd33b80b7f91e5d1aa52c457d9cbf79d64e8aee
treee60eef6b1ad9aac34beebfc1775f7ff5b934c344
parentb672f7a2519afc54b852ebb6b5b4e51d80deea57
[WebAssembly] Verify contents of relocation target before writing it

Verify that the location where a relocation is about the be
applied contains the expected existing value.

This is essentially a sanity check to catch bugs in the compiler
and the linker.

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

llvm-svn: 327325
lld/wasm/InputChunks.cpp
lld/wasm/InputFiles.cpp
lld/wasm/InputFiles.h