diff options
Diffstat (limited to 'lld/wasm/InputChunks.cpp')
| -rw-r--r-- | lld/wasm/InputChunks.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lld/wasm/InputChunks.cpp b/lld/wasm/InputChunks.cpp index 238c111ea39..5d6dfa0d989 100644 --- a/lld/wasm/InputChunks.cpp +++ b/lld/wasm/InputChunks.cpp @@ -74,11 +74,14 @@ void InputChunk::verifyRelocTargets() const { if (BytesRead && BytesRead != 5) warn("expected LEB at relocation site be 5-byte padded"); - uint32_t ExpectedValue = File->calcExpectedValue(Rel); - if (ExpectedValue != ExistingValue) - warn("unexpected existing value for " + reloctTypeToString(Rel.Type) + - ": existing=" + Twine(ExistingValue) + - " expected=" + Twine(ExpectedValue)); + + if (Rel.Type != R_WASM_GLOBAL_INDEX_LEB) { + uint32_t ExpectedValue = File->calcExpectedValue(Rel); + if (ExpectedValue != ExistingValue) + warn("unexpected existing value for " + reloctTypeToString(Rel.Type) + + ": existing=" + Twine(ExistingValue) + + " expected=" + Twine(ExpectedValue)); + } } } |

