diff options
| author | Thomas Lively <tlively@google.com> | 2019-10-15 19:05:11 +0000 |
|---|---|---|
| committer | Thomas Lively <tlively@google.com> | 2019-10-15 19:05:11 +0000 |
| commit | 190dacc3cc206fa90a44e2f4aa6b56c327d1942a (patch) | |
| tree | c6efda90caff32ebc4ad49c538b1bf2a020d2aa6 /lld/wasm/OutputSections.h | |
| parent | 0330fba6e16db9b5d2079313646f93485c5ccf39 (diff) | |
| download | bcm5719-llvm-190dacc3cc206fa90a44e2f4aa6b56c327d1942a.tar.gz bcm5719-llvm-190dacc3cc206fa90a44e2f4aa6b56c327d1942a.zip | |
[WebAssembly] Elide data segments for .bss sections
Summary:
WebAssembly memories are zero-initialized, so when module does not
import its memory initializing .bss sections is guaranteed to be a
no-op. To reduce binary size and initialization time, .bss sections
are simply not emitted into the final binary unless the memory is
imported.
Reviewers: sbc100
Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68965
llvm-svn: 374940
Diffstat (limited to 'lld/wasm/OutputSections.h')
| -rw-r--r-- | lld/wasm/OutputSections.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lld/wasm/OutputSections.h b/lld/wasm/OutputSections.h index 6b1c2a2eba2..1fcb5723df9 100644 --- a/lld/wasm/OutputSections.h +++ b/lld/wasm/OutputSections.h @@ -82,7 +82,7 @@ public: void writeTo(uint8_t *buf) override; uint32_t getNumRelocations() const override; void writeRelocations(raw_ostream &os) const override; - bool isNeeded() const override { return segments.size() > 0; } + bool isNeeded() const override; void finalizeContents() override; protected: |

