From b650f20121d7e1e79c12e6abfaf317f0d00e5f3b Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 4 Dec 2018 11:35:57 -0800 Subject: Warn if linking section is present, as we cannot handle it yet (#1798) --- src/wasm-binary.h | 2 +- src/wasm/wasm-binary.cpp | 3 +++ src/wasm/wasm.cpp | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/wasm-binary.h b/src/wasm-binary.h index eeeba98db..45052bcb2 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -341,8 +341,8 @@ enum EncodedType { namespace UserSections { extern const char* Name; extern const char* SourceMapUrl; - extern const char* Dylink; +extern const char* Linking; enum Subsection { NameFunction = 1, diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp index b36e629b0..c1cb02375 100644 --- a/src/wasm/wasm-binary.cpp +++ b/src/wasm/wasm-binary.cpp @@ -713,6 +713,9 @@ void WasmBinaryBuilder::readUserSection(size_t payloadLen) { readNames(payloadLen - (pos - oldPos)); } else { // an unfamiliar custom section + if (sectionName.equals(BinaryConsts::UserSections::Linking)) { + std::cerr << "warning: linking section is present, which binaryen cannot handle yet - relocations will be invalidated!\n"; + } wasm.userSections.resize(wasm.userSections.size() + 1); auto& section = wasm.userSections.back(); section.name = sectionName.str; diff --git a/src/wasm/wasm.cpp b/src/wasm/wasm.cpp index a1d7666ca..fe7927870 100644 --- a/src/wasm/wasm.cpp +++ b/src/wasm/wasm.cpp @@ -29,8 +29,8 @@ namespace BinaryConsts { namespace UserSections { const char* Name = "name"; const char* SourceMapUrl = "sourceMappingURL"; - const char* Dylink = "dylink"; +const char* Linking = "linking"; } } -- cgit v1.2.3