From 178cf77a735d887fe779ddc0d2230748a982e454 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Tue, 25 Apr 2017 17:13:23 +0000 Subject: [PATCH] [WebAssembly] Fix relocation count in wasm binaries with call_indirect Subscribers: jfb, dschuff Differential Revision: https://reviews.llvm.org/D32459 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301331 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/MC/WasmObjectWriter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/MC/WasmObjectWriter.cpp b/lib/MC/WasmObjectWriter.cpp index 159cc3b4def..6444046a30d 100644 --- a/lib/MC/WasmObjectWriter.cpp +++ b/lib/MC/WasmObjectWriter.cpp @@ -1105,7 +1105,7 @@ void WasmObjectWriter::writeObject(MCAssembler &Asm, encodeULEB128(wasm::WASM_SEC_CODE, getStream()); - encodeULEB128(CodeRelocations.size(), getStream()); + encodeULEB128(CodeRelocations.size() + TypeIndexFixups.size(), getStream()); WriteRelocations(CodeRelocations, getStream(), SymbolIndices); WriteTypeRelocations(TypeIndexFixups, TypeIndexFixupTypes, getStream()); -- 2.40.0