summaryrefslogtreecommitdiffstats
path: root/lld/test/wasm/data-layout.ll
Commit message (Collapse)AuthorAgeFilesLines
* [WebAssembly] Elide data segments for .bss sectionsThomas Lively2019-10-151-6/+0
| | | | | | | | | | | | | | | | | | | 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
* [WebAssembly] Sort output data sections to place .bss lastThomas Lively2019-09-191-30/+30
| | | | | | | | | | | | | | | | | | | | Summary: This was always the intended behavior, but had not been implemented. This ordering is important for Emscripten when generating .mem files while compiling to JS, since only zeros at the end of initialized memory can be dropped. Fixes https://github.com/emscripten-core/emscripten/issues/8999 Reviewers: sbc100 Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67736 llvm-svn: 372284
* [WebAssembly] Initialize memory in start functionThomas Lively2019-09-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* [WebAssembly] Use passive segments by default when memory is sharedThomas Lively2019-07-181-1/+1
| | | | | | | | | | | | | | | | | | Summary: This change makes it so that passing --shared-memory is all a user needs to do to get proper multithreaded code. This default can still be explicitly overridden for any reason using --passive-segments and --active-segments. Reviewers: sbc100, quantum Subscribers: dschuff, jgravelle-google, aheejin, sunfish, jfb, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64950 llvm-svn: 366504
* [WebAssembly] Don't export __data_end and __heap_base by default.Sam Clegg2019-05-311-2/+8
| | | | | | | | These can still be exported via --export if needed. Differential Revision: https://reviews.llvm.org/D62744 llvm-svn: 362276
* [WebAssembly] Update MC for bulk memoryThomas Lively2019-02-191-12/+12
| | | | | | | | | | | | | | | | | | Summary: Rename MemoryIndex to InitFlags and implement logic for determining data segment layout in ObjectYAML and MC. Also adds a "passive" flag for the .section assembler directive although this cannot be assembled yet because the assembler does not support data sections. Reviewers: sbc100, aardappel, aheejin, dschuff Subscribers: jgravelle-google, hiraditya, sunfish, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D57938 llvm-svn: 354397
* [WebAssembly] Update relocation naming to match llvm change. NFC.Sam Clegg2019-02-041-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D57698 llvm-svn: 353066
* [WebAssembly] Fix crash with LTO + relocatable + undefined symbolsSam Clegg2019-01-301-3/+3
| | | | | | | | | | | | Change the way we create the symbol table to be closer to how its done on ELF. Now the output symbol table matches the internal symtab order and includes local and undefined symbols. Fixes PR40204 Differential Revision: https://reviews.llvm.org/D56947 llvm-svn: 352645
* [WebAssembly] Support creation and import of shared memoriesDerek Schuff2018-11-061-0/+10
| | | | | | | | | Used for WebAssembly threads proposal. Add a flag --shared-memory which sets the IS_SHARED bit in WasmLimits Differential Revision: https://reviews.llvm.org/D54130 llvm-svn: 346248
* [WebAssembly] Allow signautre of entry function to be flexibleSam Clegg2018-05-141-2/+2
| | | | | | | | | Since we a no longer using this function for the wasm start section we don't actually care what its signature is. Differential Revision: https://reviews.llvm.org/D46594 llvm-svn: 332308
* [WebAssembly] Remove final -wasm component of target triple. NFC.Sam Clegg2018-05-101-1/+1
| | | | | | This has been the default for a while now. llvm-svn: 332009
* [WebAssembly] Check function signatures by defaultSam Clegg2018-05-051-3/+3
| | | | | | | | | But only produce a warning (for now) unless --fatal-warnings is passed. Differential Revision: https://reviews.llvm.org/D46484 llvm-svn: 331574
* [WebAssembly] Add version to linking section (to match llvm-side change)Sam Clegg2018-04-261-3/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D46070 llvm-svn: 330971
* [WebAssembly] Add missing implementation for --initial/max-memory argsNicholas Wilson2018-03-141-1/+16
| | | | | | | | | Previously, Config->InitialMemory/MaxMemory were hooked up to some commandline args but had no effect at all. Differential Revision: https://reviews.llvm.org/D44393 llvm-svn: 327508
* [WebAssembly] Fix expected contents of relocations with addendsSam Clegg2018-03-141-8/+35
| | | | | | | | | | | This fixes issues found on the wasm waterfall related to relocations with addends. Undefined symbols, even those with addends should always have a provisional value of zero. At least this is what llvm emits (and I believe this is true for ELF too). Differential Revision: https://reviews.llvm.org/D44451 llvm-svn: 327468
* [WebAssembly] Reorder symbol table to match MC orderNicholas Wilson2018-02-281-2/+2
| | | | | | | | | Update LLD test expectations for new symbol ordering introduced by Differential D43685. Differential Revision: https://reviews.llvm.org/D43875 llvm-svn: 326335
* [WebAssembly] Remove DataSize from linking metadataSam Clegg2018-02-271-1/+0
| | | | | | | | | This means we don't need to write the linking metadata section at all for executable (non-relocatable) output. Differential Revision: https://reviews.llvm.org/D42869 llvm-svn: 326268
* [WebAssembly] Add explicit symbol tableSam Clegg2018-02-231-17/+27
| | | | | | | | | | | | | | | | | | This change modified lld to in response the llvm change which moved to a more explicit symbol table in the object format. Based on patches by Nicholas Wilson: 1. https://reviews.llvm.org/D41955 2. https://reviews.llvm.org/D42585 The primary difference that we see in the test output is that for relocatable (-r) output we now have symbol table which replaces exports/imports and globals. See: https://github.com/WebAssembly/tool-conventions/issues/38 Differential Revision: https://reviews.llvm.org/D43264 llvm-svn: 325861
* Use wasm-ld instead of "lld -flavor wasm".Rui Ueyama2018-02-161-2/+2
| | | | | | | | | | Invoking lld as ld.lld, ld.ld64, lld-link or wasm-ld is preferred than invoking lld as lld and pass an -flavor option. We have "lld" file mostly for historical reasons. Differential Revision: https://reviews.llvm.org/D43407 llvm-svn: 325405
* [WebAssembly] Fix signature mismatches in test codeSam Clegg2018-02-021-2/+2
| | | | | | | | | Pass --check-signatures to test executions of lld and fix resulting errors. Differential Revision: https://reviews.llvm.org/D42661 llvm-svn: 324042
* [WebAssembly] Add support for --gc-sectionsSam Clegg2018-01-311-1/+1
| | | | | | | | | | | | | | | In this initial version we only GC symbols with `hidden` visibility since other symbols we export to the embedder. We could potentially modify this the future and only use symbols explicitly passed via `--export` as GC roots. This version of the code only does GC of data and code. GC for the types section is coming soon. Differential Revision: https://reviews.llvm.org/D42511 llvm-svn: 323842
* [WebAssembly] Use inline target tripple in test casesSam Clegg2018-01-241-2/+4
| | | | | | | | | | This is somewhat preferable since (in many cases) it allows llc to be run directly on the .ll files without having to pass the `-mtriple` argument. Differential Revision: https://reviews.llvm.org/D42438 llvm-svn: 323299
* Remove trailing whitespace.Rui Ueyama2018-01-241-6/+6
| | | | llvm-svn: 323287
* [WebAssembly] Remove --emit-relocsSam Clegg2018-01-221-40/+63
| | | | | | | | | | This was added to mimic ELF, but maintaining it has cost and we currently don't have any use for it outside of the test code. Differential Revision: https://reviews.llvm.org/D42324 llvm-svn: 323154
* [WebAssembly] Define __heap_base globalSam Clegg2018-01-171-4/+10
| | | | | | | | | This is an immutable exported global representing the start of the heap area. It is a page aligned. Differential Revision: https://reviews.llvm.org/D42030 llvm-svn: 322609
* [WebAssembly] Update YAML in tests to match LLVM changeSam Clegg2018-01-091-5/+10
| | | | | | Differential Revision: https://reviews.llvm.org/D41878 llvm-svn: 322122
* [WebAssemlby] Fix typo in target triple used in testsSam Clegg2017-12-191-2/+2
| | | | llvm-svn: 321044
* Remove trailing whitespace.Rui Ueyama2017-12-121-1/+1
| | | | llvm-svn: 320520
* [WebAssembly] Preserve ordering of global symbolsSam Clegg2017-12-111-5/+5
| | | | | | | | | | This change restores the behavior that global indexes are assigned in object file order. This was accidentally changed in https://reviews.llvm.org/D40859. Differential Revision: https://reviews.llvm.org/D41038 llvm-svn: 320426
* [WebAssembly] Improve wasm test casesSam Clegg2017-12-081-5/+2
| | | | | | | | | | | | | | | | Add test for weakly defined symbols with the same name Improve test for call-indirect to include the same call in two different objects. This lays the ground work to improve the output via de-duplicating the indirect call table: https://reviews.llvm.org/D40989 Also make all tests consistently pass -mtriple rather than declaring in the sources. Differential Revision: https://reviews.llvm.org/D41024 llvm-svn: 320172
* [WebAssembly] Add --no-entry argumentSam Clegg2017-12-081-1/+1
| | | | | | | | | | | This adds a `--no-entry` argument to wasm LLD used to suppress the default `_start` entry point. Patch by Nicholas Wilson! Differential Revision: https://reviews.llvm.org/D40725 llvm-svn: 320167
* [WebAssembly] Fix symbol exports under -r/--relocatableSam Clegg2017-12-071-5/+5
| | | | | | | | | | | | | | | This change cleans up the way wasm exports and globals are generated, particualrly for -r/--relocatable where globals need to be created and exported in order for output relocations which reference them. Remove the need for a per file GlobalIndexOffset and instead set the output index for each symbol directly. This simplifies the code in several places. Differential Revision: https://reviews.llvm.org/D40859 llvm-svn: 320001
* [WebAssembly] Initial wasm linker implementationSam Clegg2017-11-171-0/+64
This linker backend is still a work in progress but is enough to link simple programs including linking against library archives. Differential Revision: https://reviews.llvm.org/D34851 llvm-svn: 318539
OpenPOWER on IntegriCloud