summaryrefslogtreecommitdiffstats
path: root/lld/unittests
Commit message (Collapse)AuthorAgeFilesLines
* Fix DarwinLdDriverTest.cpp to pass real llvm options.Pete Cooper2015-12-161-3/+3
| | | | | | | | | | | After r255819, parse() actually parses what you pass it. This test was failing because it passed '--debug-only' which isn't in release builds, but also 'foo' which isn't an option at all. We now pass -enable-tbaa and -enable-misched which are real options. llvm-svn: 255822
* Make ELF2 the default.Rafael Espindola2015-11-171-1/+1
| | | | | | With this the only way to get the old elf linker is "-flavor old-elf". llvm-svn: 253318
* Rename gnu2 to gnu.Rafael Espindola2015-11-161-1/+1
| | | | | | This is the second step in making ELF2 the default. llvm-svn: 253270
* [Mips] Support two more MIPS linking emulation options ↵Simon Atanasyan2015-08-281-0/+6
| | | | | | elf32btsmipn32/elf32ltsmipn32 llvm-svn: 246336
* [Mips] Make "emulation" option less dependent on the "-target" option.Simon Atanasyan2015-08-281-0/+10
| | | | | | | Now it is possible to have mips-linux-gnu-ld executable and link MIPS 64-bit little-endian binaries providing -melf64ltsmip command line argument. llvm-svn: 246335
* COFF: Remove the old COFF linker and make link an alias to link2.Rui Ueyama2015-08-063-886/+0
| | | | | | It's time to remove old COFF linker because the new one is now complete. llvm-svn: 244226
* Fix -Wextra-semi.Rui Ueyama2015-07-231-2/+1
| | | | | | Patch from Eugene.Zelenko! llvm-svn: 243060
* Revert ELF port. Posting to mailing list.Michael J. Spencer2015-07-141-1/+0
| | | | llvm-svn: 242118
* Initial ELF port.Michael J. Spencer2015-07-131-0/+1
| | | | | | | | This is a direct port of the new PE/COFF linker to ELF. It can take a single object file and generate a valid executable that executes at the first byte in the text section. llvm-svn: 242088
* ArrayRef-ify Driver::parse and related functions.David Blaikie2015-06-212-2/+2
| | | | llvm-svn: 240236
* COFF: Add a new PE/COFF port.Rui Ueyama2015-05-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an initial patch for a section-based COFF linker. The patch has 2300 lines of code including comments and blank lines. Before diving into details, you want to start from reading README because it should give you an overview of the design. All important things are written in the README file, so I write summary here. - The linker is already able to self-link on Windows. - It's significantly faster than the existing implementation. The existing one takes 5 seconds to link LLD on my machine, while the new one only takes 1.2 seconds, even though the new one is not multi-threaded yet. (And a proof-of-concept multi- threaded version was able to link it in 0.5 seconds.) - It uses much less memory (250MB vs. 2GB virtual memory space to self-host). - IMHO the new code is much simpler and easier to read than the existing PE/COFF port. http://reviews.llvm.org/D10036 llvm-svn: 238458
* Remove redundant std::move on functions that return a unique_ptr.Benjamin Kramer2015-05-221-1/+1
| | | | llvm-svn: 238034
* Revert r234649 "PECOFF: Use C++11 braced init list to make Version objects."Nico Weber2015-04-111-10/+10
| | | | | | | | | | | | | | This doesn't compile with MSVC 2013: include\lld/ReaderWriter/PECOFFLinkingContext.h(356) : error C2797: 'lld::PECOFFLinkingContext::_imageVersion': list initialization inside member initializer list or non-static data member initializer is not implemented include\lld/ReaderWriter/PECOFFLinkingContext.h(357) : error C2797: 'lld::PECOFFLinkingContext::_imageVersion': list initialization inside member initializer list or non-static data member initializer is not implemented llvm-svn: 234676
* PECOFF: Use C++11 braced init list to make Version objects.Rui Ueyama2015-04-101-10/+10
| | | | llvm-svn: 234649
* Remove unused typedefs.Rui Ueyama2015-04-081-1/+1
| | | | llvm-svn: 234415
* Remove Makefiles.Rui Ueyama2015-03-263-65/+0
| | | | | | | | Most developers prefer to not have them, and we agreed to remove them from LLD. http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-March/083368.html llvm-svn: 233313
* Use arithmetic type to represent alignments (not in log2) everywhere.Rui Ueyama2015-03-261-9/+9
| | | | | | | This is the final step of conversion. Now log2 numbers are removed from everywhere! llvm-svn: 233246
* Use alignment values everywhere instead of log2.Rui Ueyama2015-03-263-21/+21
| | | | | | | | This patch defines implicit conversion between integers and PowerOf2 instances, so uses of the classes is now implicit and look like regular integers. Now we are ready to remove the scaffolding. llvm-svn: 233245
* Define an implicit constructor which takes actual alignment value to PowerOf2.Rui Ueyama2015-03-261-4/+4
| | | | | | | The new constructor's type is the same, but this one takes not a log2 value but an alignment value itself, so the meaning is totally differnet. llvm-svn: 233244
* Make PowerOf2's constructor private.Rui Ueyama2015-03-261-4/+4
| | | | | | | Ban conversion from integers to PowerOf2 even if explicit to make all places we create PowerOf2 instances visible. llvm-svn: 233243
* Remove implicit constructor and operator int from PowerOf2.Rui Ueyama2015-03-263-26/+25
| | | | | | | | | | This patch is to make instantiation and conversion to an integer explicit, so that we can mechanically replace all occurrences of the class with integer in the next step. Now get() returns an alignment value rather than its log2 value. llvm-svn: 233242
* [LinkerScript] Implement semantics for simple sections mappingsRafael Auler2015-03-161-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit implements the behaviour of the SECTIONS linker script directive, used to not only define a custom mapping between input and output sections, but also order input sections in the output file. To do this, we modify DefaultLayout with hooks at important places that allow us to re-order input sections according to a custom order. We also add a hook in SegmentChunk to allow us to calculate linker script expressions while assigning virtual addresses to the input sections that live in a segment. Not all SECTIONS constructs are currently supported, but only the ones that do not use special sort orders. It adds two LIT test as practical examples of which sections directives are currently supported. In terms of high-level changes, it creates a new class "script::Sema" that owns all linker script ASTs and the logic for linker script semantics as well. ELFLinkingContext owns a single copy of Sema, which will be used throughout the object file writing process (to layout sections as proposed by the linker script). Other high-level change is that the writer no longer uses a "const" copy of the linking context. This happens because linker script expressions must be calculated *while* calculating final virtual addresses, which is a very late step in object file writing. While calculating these expressions, we need to update the linker script symbol table (inside the semantics object), and, thus, we are "modifying our context" as we prepare to write the file. http://reviews.llvm.org/D8157 llvm-svn: 232402
* Fix configure & make build by adding support for the ExampleSubTarget.Iain Sandoe2015-03-121-2/+2
| | | | llvm-svn: 232030
* [LinkerScript] Implement linker script expression evaluationRafael Auler2015-03-091-0/+40
| | | | | | | | | | | The expression evaluation is needed when interpreting linker scripts, in order to calculate the value for new symbols or to determine a new position to load sections in memory. This commit extends Expression nodes from the linker script AST with evaluation functions, and also contains a unit test. http://reviews.llvm.org/D8156 llvm-svn: 231707
* PECOFF: allow more than one /alternatename for the same symbol.Rui Ueyama2015-02-261-3/+7
| | | | | | | | | | | Previously we have a string -> string map to keep the weak alias symbol mapping. Naturally we can't define more than one weak alias with that data structure. This patch is to allow multiple aliases for the same symbol by changing the map type to string -> set of string map. llvm-svn: 230702
* Remove YAML/Native round-trip passes.Rui Ueyama2015-02-201-1/+1
| | | | | | | | | | | | | | | | | | | | The round-trip passes were introduced in r193300. The intention of the change was to make sure that LLD is capable of reading end writing such file formats. But that turned out to be yet another over-designed stuff that had been slowing down everyday development. The passes ran after the core linker and before the writer. If you had an additional piece of information that needs to be passed from front-end to the writer, you had to invent a way to save the data to YAML/Native. These passes forced us to do that even if that data was not needed to be represented neither in an object file nor in an executable/DSO. It doesn't make sense. We don't need these passes. http://reviews.llvm.org/D7480 llvm-svn: 230069
* MSVC 2013 appears to be able to compile make_ptr_range without issue, so ↵Aaron Ballman2015-02-161-3/+0
| | | | | | removing that guard in the unit test. llvm-svn: 229410
* Unittest: Do s/_context/_ctx/g.Rui Ueyama2015-02-104-210/+210
| | | | llvm-svn: 228750
* GNU: Add --no-export-dynamic command line option.Rui Ueyama2015-02-101-0/+12
| | | | llvm-svn: 228749
* Use override rather than virtual.Rui Ueyama2015-02-101-1/+1
| | | | llvm-svn: 228723
* GNU: Use StringRef::empty instead of a boolean flag.Rui Ueyama2015-02-101-0/+5
| | | | | | | This local variable name did not follow the style guide, and it is not actually needed. llvm-svn: 228722
* [Cleanup] Remove member functions added to support nostdlibShankar Easwaran2015-02-061-5/+4
| | | | | | No change in functionality. llvm-svn: 228379
* [ELF] Fix -nostdlib option.Shankar Easwaran2015-02-061-1/+12
| | | | | | | | | Only search library directories explicitly specified on the command line. Library directories specified in linker scripts (including linker scripts specified on the command line) are ignored. llvm-svn: 228375
* The PPC lld backend has been removed, don't require it here.Eric Christopher2015-02-051-1/+1
| | | | llvm-svn: 228251
* ELF: Support INPUT linker script directiveRui Ueyama2015-02-031-0/+8
| | | | | | | | | | INPUT directive is a variant of GROUP in the sense that that specifies a list of input files. The only difference is whether the entire file list is wrapped with a --start-group/--end-group or not. http://reviews.llvm.org/D7390 llvm-svn: 228060
* ELF: Improve linker script unit tests.Rui Ueyama2015-02-031-55/+44
| | | | | | | This patch is to enable to write unit tests for linker script with less boilerplate code. llvm-svn: 227902
* [ELF] Implement action for OUTPUT linker script commandDavide Italiano2015-02-021-0/+13
| | | | | | Reviewed by: ruiu, shankarke llvm-svn: 227787
* [ELF] Implement semantic action for ENTRY linker script command.Davide Italiano2015-02-011-0/+13
| | | | | | Reviewed by: shankarke, ruiu llvm-svn: 227708
* Implement semantic action for SEARCH_DIR linker script commandRafael Auler2015-01-311-0/+14
| | | | | | | | | | | | This is needed, among others by the FreeBSD kernel linker script. Patch by Davide Italiano! Reviewers: ruiu, rafaelauler Differential Revision: http://reviews.llvm.org/D7220 llvm-svn: 227694
* ELF: add a unit test for --as-needed.Rui Ueyama2015-01-281-0/+13
| | | | llvm-svn: 227367
* Add a unit test for LinkerScript.Rui Ueyama2015-01-281-0/+19
| | | | llvm-svn: 227341
* Fix shared library buildGreg Fitzgerald2015-01-261-0/+3
| | | | | | | | | * Removed cyclic dependency between lldPECOFF and lldDriver * Added missing dependencies in unit tests Differential Revision: http://reviews.llvm.org/D7185 llvm-svn: 227134
* Add ARM backend to the autotools buildGreg Fitzgerald2015-01-221-1/+2
| | | | | From: Greg Fitzgerald <garious@gmail.com> llvm-svn: 226782
* [ELF] Do not error on non-existent file in the driver.Rui Ueyama2015-01-151-43/+18
| | | | | | | This change makes it easy to write unit tests for the GNU driver. No more "empty group" hack is needed. No change in functionality. llvm-svn: 226150
* Remove InputGraph and use std::vector<Node> instead.Rui Ueyama2015-01-151-2/+2
| | | | | | In total we have removed more than 1000 lines! llvm-svn: 226149
* Rename InputElement Node.Rui Ueyama2015-01-151-4/+3
| | | | | | | | | InputElement was named that because it's an element of an InputGraph. It's losing the origin because the InputGraph is now being removed. InputElement's subclass is FileNode, that naming inconsistency needed to be fixed. llvm-svn: 226147
* Remove FileNode::getPath().Rui Ueyama2015-01-151-2/+2
| | | | | | | Previously both FileNode and File keep filename. This patch removed that redundancy. llvm-svn: 226143
* Remove InputGraph::size().Rui Ueyama2015-01-151-2/+4
| | | | llvm-svn: 226140
* [PECOFF] Remove an InputElement placeholder for the entry name.Rui Ueyama2015-01-151-21/+21
| | | | llvm-svn: 226133
* Re-commit r225766, r225767, r225769, r225814, r225816, r225829, and r225832.Rui Ueyama2015-01-152-123/+0
| | | | | | | These changes depended on r225674 and had been rolled back in r225859. Because r225674 has been re-submitted, it's safe to re-submit them. llvm-svn: 226132
OpenPOWER on IntegriCloud