[WebAssembly] Add validation to reloc section
authorNicholas Wilson <nicholas@nicholaswilson.me.uk>
Mon, 5 Mar 2018 13:32:38 +0000 (13:32 +0000)
committerNicholas Wilson <nicholas@nicholaswilson.me.uk>
Mon, 5 Mar 2018 13:32:38 +0000 (13:32 +0000)
commitb3748f71df37d2ec7031a99fbe4f0323a264a013
tree824a03a5aeb5011158b1b0d2e9438fc01e9f916f
parentf20222a83c8f76c52c89201627857c055e879f02
[WebAssembly] Add validation to reloc section

We now check relocations offsets are within range, and the relocation
index is valid.

Also updated tests which contained invalid Wasm files that were
previously not checked.

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

llvm-svn: 326697
llvm/include/llvm/Object/Wasm.h
llvm/lib/Object/WasmObjectFile.cpp
llvm/test/ObjectYAML/wasm/code_section.yaml
llvm/test/ObjectYAML/wasm/data_section.yaml