commit | 1a53ff2a13fd0045ee3bf23d84608153864b4567 | [log] [tgz] |
---|---|---|
author | Sam Clegg <sbc@chromium.org> | Thu May 16 21:22:43 2019 +0000 |
committer | Sam Clegg <sbc@chromium.org> | Thu May 16 21:22:43 2019 +0000 |
tree | 96ea0b526eb4c421184fecfe724a4744cba938f9 | |
parent | 9adabefdcee693e69f38e10c41c67b80ff06c669 [diff] [blame] |
[WebAssembly] Don't generate empty type sections. Differential Revision: https://reviews.llvm.org/D61991 llvm-svn: 360940
diff --git a/lld/wasm/Writer.cpp b/lld/wasm/Writer.cpp index fedaa54..8460f85 100644 --- a/lld/wasm/Writer.cpp +++ b/lld/wasm/Writer.cpp
@@ -234,6 +234,8 @@ } void Writer::createTypeSection() { + if (!Types.size()) + return; SyntheticSection *Section = createSyntheticSection(WASM_SEC_TYPE); raw_ostream &OS = Section->getStream(); writeUleb128(OS, Types.size(), "type count");