[llvm] fb7c366 - [yaml2obj][wasm] Support numeric relocation type
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 2 18:28:44 PST 2021
Author: Fangrui Song
Date: 2021-02-02T18:28:37-08:00
New Revision: fb7c36636ded085e87daa4010f1dfc73a748c794
URL: https://github.com/llvm/llvm-project/commit/fb7c36636ded085e87daa4010f1dfc73a748c794
DIFF: https://github.com/llvm/llvm-project/commit/fb7c36636ded085e87daa4010f1dfc73a748c794.diff
LOG: [yaml2obj][wasm] Support numeric relocation type
Differential Revision: https://reviews.llvm.org/D95661
Added:
Modified:
llvm/lib/ObjectYAML/WasmYAML.cpp
llvm/test/ObjectYAML/wasm/event_section.yaml
Removed:
################################################################################
diff --git a/llvm/lib/ObjectYAML/WasmYAML.cpp b/llvm/lib/ObjectYAML/WasmYAML.cpp
index b4d2d113fb5a..b717bb5a560a 100644
--- a/llvm/lib/ObjectYAML/WasmYAML.cpp
+++ b/llvm/lib/ObjectYAML/WasmYAML.cpp
@@ -614,6 +614,7 @@ void ScalarEnumerationTraits<WasmYAML::RelocType>::enumeration(
#define WASM_RELOC(name, value) IO.enumCase(Type, #name, wasm::name);
#include "llvm/BinaryFormat/WasmRelocs.def"
#undef WASM_RELOC
+ IO.enumFallback<Hex32>(Type);
}
} // end namespace yaml
diff --git a/llvm/test/ObjectYAML/wasm/event_section.yaml b/llvm/test/ObjectYAML/wasm/event_section.yaml
index ddeabd602645..54f27d6c045b 100644
--- a/llvm/test/ObjectYAML/wasm/event_section.yaml
+++ b/llvm/test/ObjectYAML/wasm/event_section.yaml
@@ -27,6 +27,9 @@ Sections:
- Type: R_WASM_EVENT_INDEX_LEB
Index: 1
Offset: 0x00000006
+ - Type: 10
+ Index: 1
+ Offset: 0x00000006
Functions:
- Index: 0
Locals:
@@ -74,6 +77,9 @@ Sections:
# CHECK-NEXT: - Type: R_WASM_EVENT_INDEX_LEB
# CHECK-NEXT: Index: 1
# CHECK-NEXT: Offset: 0x6
+# CHECK-NEXT: - Type: R_WASM_EVENT_INDEX_LEB
+# CHECK-NEXT: Index: 1
+# CHECK-NEXT: Offset: 0x6
# CHECK-NEXT: Functions:
# CHECK-NEXT: - Index: 0
# CHECK-NEXT: Locals:
More information about the llvm-commits
mailing list