Skip to content

Commit

Permalink
[WebAssembly] Fix WasmEmitter link error.
Browse files Browse the repository at this point in the history
  • Loading branch information
aardappel committed Apr 17, 2020
1 parent a1526cd commit 3eaeebe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion llvm/lib/ObjectYAML/WasmEmitter.cpp
Expand Up @@ -530,7 +530,12 @@ void WasmWriter::writeRelocSection(raw_ostream &OS, WasmYAML::Section &Sec,
writeUint8(OS, Reloc.Type);
encodeULEB128(Reloc.Offset, OS);
encodeULEB128(Reloc.Index, OS);
if (wasm::relocTypeHasAddend(Reloc.Type)) {
switch (Reloc.Type) {
case wasm::R_WASM_MEMORY_ADDR_LEB:
case wasm::R_WASM_MEMORY_ADDR_SLEB:
case wasm::R_WASM_MEMORY_ADDR_I32:
case wasm::R_WASM_FUNCTION_OFFSET_I32:
case wasm::R_WASM_SECTION_OFFSET_I32:
encodeULEB128(Reloc.Addend, OS);
}
}
Expand Down

0 comments on commit 3eaeebe

Please sign in to comment.