aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ObjectYAML/WasmYAML.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2019-05-07 03:53:16 +0000
committerSam Clegg <sbc@chromium.org>2019-05-07 03:53:16 +0000
commit5f8c2edef355e05c2041eba69b482f13a358abf6 (patch)
tree6674c0ab08df28e79d16e2ff6b1d7fde08ce6c68 /llvm/lib/ObjectYAML/WasmYAML.cpp
parentc72aaf62d3f92c0c6d33b4df2253505f6eb22996 (diff)
downloadllvm-5f8c2edef355e05c2041eba69b482f13a358abf6.zip
llvm-5f8c2edef355e05c2041eba69b482f13a358abf6.tar.gz
llvm-5f8c2edef355e05c2041eba69b482f13a358abf6.tar.bz2
[WebAssembly] Add more test coverage for reloctions against section symbols
The only known user of this relocation type and symbol type is the debug info sections, but we were not testing the `--relocatable` output path. This change adds a minimal test case to cover relocations against section symbols includes `--relocatable` output. Differential Revision: https://reviews.llvm.org/D61623 llvm-svn: 360110
Diffstat (limited to 'llvm/lib/ObjectYAML/WasmYAML.cpp')
-rw-r--r--llvm/lib/ObjectYAML/WasmYAML.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/ObjectYAML/WasmYAML.cpp b/llvm/lib/ObjectYAML/WasmYAML.cpp
index 214aa1c..88491d9 100644
--- a/llvm/lib/ObjectYAML/WasmYAML.cpp
+++ b/llvm/lib/ObjectYAML/WasmYAML.cpp
@@ -484,7 +484,8 @@ void MappingTraits<WasmYAML::SymbolInfo>::mapping(IO &IO,
WasmYAML::SymbolInfo &Info) {
IO.mapRequired("Index", Info.Index);
IO.mapRequired("Kind", Info.Kind);
- IO.mapRequired("Name", Info.Name);
+ if (Info.Kind != wasm::WASM_SYMBOL_TYPE_SECTION)
+ IO.mapRequired("Name", Info.Name);
IO.mapRequired("Flags", Info.Flags);
if (Info.Kind == wasm::WASM_SYMBOL_TYPE_FUNCTION) {
IO.mapRequired("Function", Info.ElementIndex);