diff options
author | Alon Zakai <alonzakai@gmail.com> | 2018-12-04 11:35:57 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-04 11:35:57 -0800 |
commit | b650f20121d7e1e79c12e6abfaf317f0d00e5f3b (patch) | |
tree | 65ae5de545e8fc021cfe32b6be32a34ae754dbc5 | |
parent | bebbeb54f177bdc2cfdff71d6a256a35f2f2057b (diff) | |
download | binaryen-b650f20121d7e1e79c12e6abfaf317f0d00e5f3b.tar.gz binaryen-b650f20121d7e1e79c12e6abfaf317f0d00e5f3b.tar.bz2 binaryen-b650f20121d7e1e79c12e6abfaf317f0d00e5f3b.zip |
Warn if linking section is present, as we cannot handle it yet (#1798)
-rw-r--r-- | src/wasm-binary.h | 2 | ||||
-rw-r--r-- | src/wasm/wasm-binary.cpp | 3 | ||||
-rw-r--r-- | src/wasm/wasm.cpp | 2 |
3 files changed, 5 insertions, 2 deletions
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"; } } |