summaryrefslogtreecommitdiffstats
path: root/lld/wasm/Symbols.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [WebAssembly] Refactor linker-generated symbols. NFC.Sam Clegg2018-02-021-0/+5
| | | | | | | | | | | | Group all synthetic symbols in the in single struct to match the ELF linker. This change is part of a larger change to add more linker symbols such as `_end` and `_edata`. Differential Revision: https://reviews.llvm.org/D42866 llvm-svn: 324157
* clang formatSam Clegg2018-01-281-8/+8
| | | | llvm-svn: 323622
* [WebAssemly] Associate symbol with InputChunk in which they are defined. NFC.Sam Clegg2018-01-281-18/+17
| | | | | | | | | | | | | | | | Summary: Rather than explicit Function or InputSegment points store a pointer to the base class (InputChunk) and use llvm dynamic casts when we need a subtype. This change is useful for add the upcoming gc-section support wants to deal with all input chunks. Subscribers: aheejin, llvm-commits Differential Revision: https://reviews.llvm.org/D42625 llvm-svn: 323621
* [WebAssembly] Don't duplicate functions in table outputSam Clegg2018-01-241-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | Previously, we were ensuring that the "output index" for InputFunctions was unique across all symbols that referenced a function body, but allowing the same function body to have multiple table indexes. Now, we use the same mechanism for table indexes as we already do for output indexes, ensuring that each InputFunction is only placed in the table once. This makes the LLD output table denser and smaller, but should not change the behaviour. Note that we still need the `Symbol::TableIndex` member, to store the table index for function Symbols that don't have an InputFunction, i.e. for address-taken imports. Patch by Nicholas Wilson! Differential Revision: https://reviews.llvm.org/D42476 llvm-svn: 323379
* [WebAssembly] Remove special handling of entry point export.Sam Clegg2018-01-201-0/+1
| | | | | | | | | | | | Its much easier to export it via setHidden(false), now that that is a thing. As a side effect the start function is not longer always exports first (becuase its being exported just like all the other function). Differential Revision: https://reviews.llvm.org/D42321 llvm-svn: 323025
* [WebAssembly] Add --export flag to force a symbol to be exportedSam Clegg2018-01-121-0/+8
| | | | | | | | | | This is useful for emscripten or other tools that want to selectively exports symbols without necessarily changing the source code. Differential Revision: https://reviews.llvm.org/D42003 llvm-svn: 322408
* [WebAssembly] Don't allow functions to be named more than onceSam Clegg2018-01-121-1/+1
| | | | | | | | | | Even though a function can have multiple names in the linking standards (i.e. due to aliases), there can only be one name for a given function in the NAME section. Differential Revision: https://reviews.llvm.org/D41975 llvm-svn: 322383
* [WebAssembly] Add InputChunk as common base class for InputSegment and ↵Sam Clegg2018-01-101-2/+1
| | | | | | | | InputFunction. NFC. Differential Revision: https://reviews.llvm.org/D41419 llvm-svn: 322148
* [WebAssembly] Refactor symbol and symbol table to remove WasmSymbol referencesSam Clegg2018-01-101-19/+19
| | | | | | | | | | | | | | | This WasmSymbol types comes directly from the input objects but we want to be able to represent synthetic symbols too. This is more in line with how the ELF linker represents symbols. This change also removes the logic from Symbol::getVirtualAddress for finding the global address and instead has the InputFile provide this. Differential Revision: https://reviews.llvm.org/D41426 llvm-svn: 322145
* [WebAssembly] Output functions individuallySam Clegg2018-01-091-14/+28
| | | | | | | | | | | | | The code section is now written out one function at a time rather than all the functions in a given objects being serialized at once. This change lays the groundwork for supporting --gc-sections. Differential Revision: https://reviews.llvm.org/D41315 llvm-svn: 322138
* [WebAssembly] Write out undefined symbol addresses as zeroSam Clegg2018-01-081-7/+1
| | | | | | | | | | | | | The addresses of undefined symbols that make it into the final executable (i.e. weak references to non-existent symbols) should resolve to zero. Also, make sure to not include function in the indirect function table if they are not included in the output. Differential Revision: https://reviews.llvm.org/D41839 llvm-svn: 322045
* [WebAssembly] De-dup indirect function table.Sam Clegg2017-12-111-1/+7
| | | | | | | | | | | | | | | | Create the indirect function table based on symbols rather than just duplicating the input entries. This has the effect of de-duplicating the table. This is a followup to the equivalent change made for globals: https://reviews.llvm.org/D40859 Partially based on a patch by Nicholas Wilson: https://reviews.llvm.org/D40845 Differential Revision: https://reviews.llvm.org/D40989 llvm-svn: 320428
* [WebAssembly] Add check to ensure symbol VA is only set once. NFC.Sam Clegg2017-12-081-0/+1
| | | | | | | | Also remove resulting unneeded function. Differential Revision: https://reviews.llvm.org/D40990 llvm-svn: 320118
* [WebAssembly] Remove wasm/Strings.cpp+hSam Clegg2017-12-061-2/+5
| | | | | | | | | This file contained only a single function that was only really needed in one place, so just inline it. Differential Revision: https://reviews.llvm.org/D40870 llvm-svn: 319876
* [WebAssembly] Improve support linker synthetic symbolsSam Clegg2017-12-051-0/+7
| | | | | | | | | | | | | This is part of larger change to add synthetic symbols for section start/end points and init/fini_array: https://reviews.llvm.org/D40760 Allows synthetic global symbols to have an explicitly set virtual address. Differential Revision: https://reviews.llvm.org/D40843 llvm-svn: 319813
* toString function take a const refs where possibleSam Clegg2017-12-051-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D40824 llvm-svn: 319787
* Reland "[WebAssembly] Add support for visibility flag""Sam Clegg2017-12-031-0/+2
| | | | | | | | Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish Differential Revision: https://reviews.llvm.org/D40773 llvm-svn: 319627
* [WebAssembly] Revert r319592 "Add support for visibility flag"Heejin Ahn2017-12-021-2/+0
| | | | | | | | | r319488 reportedly broke one of LLVM bots (ubuntu-gcc7.1-werror), and this patch depends on that patch. See http://lab.llvm.org:8011/builders/ubuntu-gcc7.1-werror/builds/3369 for details. llvm-svn: 319603
* [WebAssembly] Add support for visibility flagSam Clegg2017-12-011-0/+2
| | | | | | | | Patch by Nicholas Wilson Differential Revision: https://reviews.llvm.org/D40690 llvm-svn: 319592
* [WebAssembly] Allow function signature checking at link timeSam Clegg2017-11-301-14/+5
| | | | | | | | | | | | | | This change allows checking of function signatures but does not yes enable it by default. In this mode, linking two objects that were compiled with a different signatures for the same function will produce a link error. New options for enabling and disabling this feature have been added: (--check-signatures/--no-check-signatures). Differential Revision: https://reviews.llvm.org/D40371 llvm-svn: 319396
* [WebAssembly] Initial wasm linker implementationSam Clegg2017-11-171-0/+104
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