summaryrefslogtreecommitdiffstats
path: root/lld/wasm/SyntheticSections.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [WebAssembly] Elide data segments for .bss sectionsThomas Lively2019-10-151-0/+6
| | | | | | | | | | | | | | | | | | | 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
* [lld][WebAssembly] Fix static linking of -fPIC code with external undefined dataJames Clarke2019-10-151-1/+5
| | | | | | | | | | | | | | Reviewers: ruiu, sbc100 Reviewed By: sbc100 Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68991 llvm-svn: 374913
* [WebAssembly] Wrap definitions in namespace lld { namespace wasm {. NFCFangrui Song2019-10-101-3/+6
| | | | | | | | | | Similar to D68323, but for wasm. Reviewed By: ruiu Differential Revision: https://reviews.llvm.org/D68759 llvm-svn: 374279
* [lld][WebAssembly] Fix static linking of -fPIC code with external undefined ↵Sam Clegg2019-09-241-13/+20
| | | | | | | | functions Differential Revision: https://reviews.llvm.org/D66784 llvm-svn: 372779
* [lld][WebAssembly] Preserve symbol flags in --relocatable outputSam Clegg2019-09-231-21/+1
| | | | | | | | Fixes https://github.com/emscripten-core/emscripten/issues/8879 Differential Revision: https://reviews.llvm.org/D67729 llvm-svn: 372660
* [WebAssembly] Initialize memory in start functionThomas Lively2019-09-041-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: - `__wasm_init_memory` is now the WebAssembly start function instead of being called from `__wasm_call_ctors` or called directly by the runtime. - Adds a new synthetic data symbol `__wasm_init_memory_flag` that is atomically incremented from zero to one by the thread responsible for initializing memory. - All threads now unconditionally perform data.drop on all passive segments. - Removes --passive-segments and --active-segments flags and controls segment type based on --shared-memory instead. The deleted flags were only present to ameliorate the upgrade path in Emscripten. Reviewers: sbc100, aheejin Subscribers: dschuff, jgravelle-google, sunfish, jfb, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65783 llvm-svn: 370965
* [lld][WebAssembly] Support for growable tablesJacob Gravelle2019-08-271-1/+5
| | | | | | | | | | | | | | | Adds --growable-table flag to handle building wasm modules with tables that can grow. Wasm tables that we use to store function pointers. In order to add functions to that table at runtime, we need to either preallocate space, or grow the table. In order to specify a table with no maximum size, we need some flag to handle that case, separately from a potential --max-table-size= flag. Note that the number of elements in the table isn't knowable until link-time, so it's unclear if we will want a --max-table-size= flag in the future. llvm-svn: 370127
* [lld][WebAssembly] Store table base in config rather than passing it around. ↵Sam Clegg2019-08-271-5/+5
| | | | | | | | | | | NFC. I've got another change that makes more use of this value in other places. Differential Revision: https://reviews.llvm.org/D66777 llvm-svn: 370010
* [lld][WebAssembly] Allow linking of pic code into static binariesSam Clegg2019-08-131-6/+28
| | | | | | | | | | | | Summary: See https://github.com/emscripten-core/emscripten/issues/9013 Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65922 llvm-svn: 368719
* [WebAssembly] Rename variale references in comments after VariableName -> ↵Fangrui Song2019-07-161-2/+2
| | | | | | variableName change llvm-svn: 366192
* [Coding style change][lld] Rename variables for non-ELF portsRui Ueyama2019-07-111-345/+345
| | | | | | | | | | | This patch does the same thing as r365595 to other subdirectories, which completes the naming style change for the entire lld directory. With this, the naming style conversion is complete for lld. Differential Revision: https://reviews.llvm.org/D64473 llvm-svn: 365730
* Make functions and member variables distinguishable even after the name ↵Rui Ueyama2019-07-101-7/+8
| | | | | | style change. NFC. llvm-svn: 365605
* [WebAssembly] Add option to emit passive segmentsThomas Lively2019-07-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Summary: Adds `--passive-segments` and `--active-segments` flags to control what kind of segments are emitted. For now the default is always to emit active segments so this is not a breaking change, but in the future the default will be changed to passive segments when shared memory is requested and active segments otherwise. When passive segments are emitted, corresponding memory.init and data.drop instructions are emitted in a `__wasm_init_memory` function that is automatically called at the beginning of `__wasm_call_ctors`. Reviewers: sbc100, aheejin, dschuff Subscribers: azakai, dschuff, jgravelle-google, sunfish, jfb, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59343 llvm-svn: 365088
* [WebAssembly] Seal imports section before counting importsSam Clegg2019-05-231-4/+7
| | | | | | | | | | | | | | | | | | | | | | | Summary: Before we can assign entries in the function of global index space we need to know the total number of function and global imports respectively. To avoid programmer error this change seals that imports section before assigned function and global index space. Any attempt to add an import after the section is sealed will assert. The lack this such as check caused https://reviews.llvm.org/D61876 to be reverted. I'm also trying to craft a test case the this failure. Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62240 llvm-svn: 361470
* [WebAssembly] Refactor synthetic sections and relocation processing. NFC.Sam Clegg2019-05-211-0/+543
Major refactor to better match the structure of the ELF linker. - Split out relocation processing into scanRelocations - Split out synthetic sections into their own classes. Differential Revision: https://reviews.llvm.org/D61811 llvm-svn: 361233
OpenPOWER on IntegriCloud