[WebAssembly] Write DWARF data into wasm object file
- Writes ".debug_XXX" into corresponding custom sections.
- Writes relocation records into "reloc.debug_XXX" sections.
Patch by Yury Delendik!
Differential Revision: https://reviews.llvm.org/D44184
llvm-svn: 330982
diff --git a/llvm/lib/ObjectYAML/WasmYAML.cpp b/llvm/lib/ObjectYAML/WasmYAML.cpp
index ff75bfc..3c20bb7 100644
--- a/llvm/lib/ObjectYAML/WasmYAML.cpp
+++ b/llvm/lib/ObjectYAML/WasmYAML.cpp
@@ -405,6 +405,8 @@
IO.mapOptional("Offset", Info.DataRef.Offset, 0u);
IO.mapRequired("Size", Info.DataRef.Size);
}
+ } else if (Info.Kind == wasm::WASM_SYMBOL_TYPE_SECTION) {
+ IO.mapRequired("Section", Info.ElementIndex);
} else {
llvm_unreachable("unsupported symbol kind");
}
@@ -439,6 +441,7 @@
ECase(FUNCTION);
ECase(DATA);
ECase(GLOBAL);
+ ECase(SECTION);
#undef ECase
}