aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/obj2yaml/wasm2yaml.cpp
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2019-04-12 22:27:48 +0000
committerThomas Lively <tlively@google.com>2019-04-12 22:27:48 +0000
commitfef8de66a6ad56d71eb8bf8a401f8cdc82dea225 (patch)
tree55b9ddd2be0fc7c1ac1ef4b1683aa44bee339bc8 /llvm/tools/obj2yaml/wasm2yaml.cpp
parentbdb5e4e4ca5fbc7ef528067b65dda298e191e059 (diff)
downloadllvm-fef8de66a6ad56d71eb8bf8a401f8cdc82dea225.zip
llvm-fef8de66a6ad56d71eb8bf8a401f8cdc82dea225.tar.gz
llvm-fef8de66a6ad56d71eb8bf8a401f8cdc82dea225.tar.bz2
[WebAssembly] Add DataCount section to object files
Summary: This ensures that object files will continue to validate as WebAssembly modules in the presence of bulk memory operations. Engines that don't support bulk memory operations will not recognize the DataCount section and will report validation errors, but that's ok because object files aren't supposed to be run directly anyway. Reviewers: aheejin, dschuff, sbc100 Subscribers: jgravelle-google, hiraditya, sunfish, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60623 llvm-svn: 358315
Diffstat (limited to 'llvm/tools/obj2yaml/wasm2yaml.cpp')
-rw-r--r--llvm/tools/obj2yaml/wasm2yaml.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/tools/obj2yaml/wasm2yaml.cpp b/llvm/tools/obj2yaml/wasm2yaml.cpp
index eacbe62..47d984b 100644
--- a/llvm/tools/obj2yaml/wasm2yaml.cpp
+++ b/llvm/tools/obj2yaml/wasm2yaml.cpp
@@ -353,6 +353,12 @@ ErrorOr<WasmYAML::Object *> WasmDumper::dump() {
S = std::move(DataSec);
break;
}
+ case wasm::WASM_SEC_DATACOUNT: {
+ auto DataCountSec = make_unique<WasmYAML::DataCountSection>();
+ DataCountSec->Count = Obj.dataSegments().size();
+ S = std::move(DataCountSec);
+ break;
+ }
default:
llvm_unreachable("Unknown section type");
break;