[llvm] r301331 - [WebAssembly] Fix relocation count in wasm binaries with call_indirect

Sam Clegg via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 25 10:13:23 PDT 2017


Author: sbc
Date: Tue Apr 25 12:13:23 2017
New Revision: 301331

URL: http://llvm.org/viewvc/llvm-project?rev=301331&view=rev
Log:
[WebAssembly] Fix relocation count in wasm binaries with call_indirect

Subscribers: jfb, dschuff

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

Modified:
    llvm/trunk/lib/MC/WasmObjectWriter.cpp

Modified: llvm/trunk/lib/MC/WasmObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/WasmObjectWriter.cpp?rev=301331&r1=301330&r2=301331&view=diff
==============================================================================
--- llvm/trunk/lib/MC/WasmObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/WasmObjectWriter.cpp Tue Apr 25 12:13:23 2017
@@ -1105,7 +1105,7 @@ void WasmObjectWriter::writeObject(MCAss
 
     encodeULEB128(wasm::WASM_SEC_CODE, getStream());
 
-    encodeULEB128(CodeRelocations.size(), getStream());
+    encodeULEB128(CodeRelocations.size() + TypeIndexFixups.size(), getStream());
 
     WriteRelocations(CodeRelocations, getStream(), SymbolIndices);
     WriteTypeRelocations(TypeIndexFixups, TypeIndexFixupTypes, getStream());




More information about the llvm-commits mailing list