diff options
author | Sam Clegg <sbc@chromium.org> | 2018-05-05 00:18:43 +0000 |
---|---|---|
committer | Sam Clegg <sbc@chromium.org> | 2018-05-05 00:18:43 +0000 |
commit | c1953144acfe6d1d58bad73b3b5ee4e1eb868c1c (patch) | |
tree | 31ad822d51a511704288e9696c134ccf6f6a3115 /lld/wasm/InputChunks.h | |
parent | b6e64e734d80723c7e7c5b8e77f4b4a2d0a4c9e6 (diff) | |
download | bcm5719-llvm-c1953144acfe6d1d58bad73b3b5ee4e1eb868c1c.tar.gz bcm5719-llvm-c1953144acfe6d1d58bad73b3b5ee4e1eb868c1c.zip |
[WebAssembly] Only perform sanity checking of relocation targets in debug builds
Also:
- Reduce the error to a warning so that debug and release
versions can still link the same inputs.
- Add another check to verify the input LEB is padded to 5 bytes
Differential Revision: https://reviews.llvm.org/D46479
llvm-svn: 331571
Diffstat (limited to 'lld/wasm/InputChunks.h')
-rw-r--r-- | lld/wasm/InputChunks.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lld/wasm/InputChunks.h b/lld/wasm/InputChunks.h index 4bebfbd940f..b816ff8468f 100644 --- a/lld/wasm/InputChunks.h +++ b/lld/wasm/InputChunks.h @@ -79,6 +79,10 @@ protected: virtual ArrayRef<uint8_t> data() const = 0; virtual uint32_t getInputSectionOffset() const = 0; + // Verifies the existing data at relocation targets matches our expectations. + // This is performed only debug builds as an extra sanity check. + void verifyRelocTargets() const; + std::vector<WasmRelocation> Relocations; Kind SectionKind; }; |