Skip to content

Commit 3eaeebe

Browse files
committed
[WebAssembly] Fix WasmEmitter link error.
1 parent a1526cd commit 3eaeebe

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

llvm/lib/ObjectYAML/WasmEmitter.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,12 @@ void WasmWriter::writeRelocSection(raw_ostream &OS, WasmYAML::Section &Sec,
530530
writeUint8(OS, Reloc.Type);
531531
encodeULEB128(Reloc.Offset, OS);
532532
encodeULEB128(Reloc.Index, OS);
533-
if (wasm::relocTypeHasAddend(Reloc.Type)) {
533+
switch (Reloc.Type) {
534+
case wasm::R_WASM_MEMORY_ADDR_LEB:
535+
case wasm::R_WASM_MEMORY_ADDR_SLEB:
536+
case wasm::R_WASM_MEMORY_ADDR_I32:
537+
case wasm::R_WASM_FUNCTION_OFFSET_I32:
538+
case wasm::R_WASM_SECTION_OFFSET_I32:
534539
encodeULEB128(Reloc.Addend, OS);
535540
}
536541
}

0 commit comments

Comments
 (0)