summaryrefslogtreecommitdiffstats
path: root/lld/COFF/Driver.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* COFF: Use the empty string as the current directory instead of ".".Rui Ueyama2015-06-081-1/+2
| | | | | | | This is NFC but makes log message a bit nicer because it doesn't append .\ (or ./ on Unix) to files in the current directory. llvm-svn: 239290
* COFF: Add more log messages.Rui Ueyama2015-06-081-0/+2
| | | | llvm-svn: 239289
* COFF: Remove dead code.Rui Ueyama2015-06-071-4/+0
| | | | | | | /include'ed symbols are already added to Config->GCRoots. Marking symbols twice doesn't have any effect. llvm-svn: 239266
* COFF: Add /opt:noref option.Rui Ueyama2015-06-071-0/+15
| | | | | | This option disables dead-stripping. llvm-svn: 239243
* COFF: Support resonpse files.Rui Ueyama2015-06-071-21/+2
| | | | llvm-svn: 239242
* COFF: Fix default output file path.Rui Ueyama2015-06-071-12/+12
| | | | | | | Default output filename is the same as the first object file's name with its extension replaced with ".exe". llvm-svn: 239238
* COFF: Add /failifmismatch option.Rui Ueyama2015-06-041-0/+11
| | | | llvm-svn: 239073
* Add comments.Rui Ueyama2015-06-041-1/+2
| | | | llvm-svn: 239072
* COFF: /include'd symbols must be preserved.Rui Ueyama2015-06-041-2/+8
| | | | | | | | | Not only entry point symbol but also symbols specified by /include option must be preserved, as they will never be dead-stripped. http://reviews.llvm.org/D10220 llvm-svn: 239005
* COFF: Remove BitcodeFile::BitcodeFile(StringRef Filename).Rui Ueyama2015-06-011-1/+1
| | | | | | | | In r238690, I made all files have only MemoryBufferRefs. This change is to do the same thing for the bitcode file reader. Also updated a few variable names to match with other code. llvm-svn: 238782
* COFF: Initial implementation of link-time optimization.Peter Collingbourne2015-06-011-0/+16
| | | | | | | | This implementation is known to work in very simple cases (see new test case). Differential Revision: http://reviews.llvm.org/D10115 llvm-svn: 238777
* Fix comments.Rui Ueyama2015-06-011-1/+1
| | | | llvm-svn: 238718
* COFF: Fix /include. Included symbols are GC-roots.Rui Ueyama2015-06-011-0/+4
| | | | llvm-svn: 238717
* COFF: Define an error category for the linker.Rui Ueyama2015-06-011-1/+0
| | | | | | | | | | | | | Instead of returning non-categorized errors, return categorized errors. All uses of make_dynamic_error_code are removed. Because we don't have error reporting mechanism, I just chose to print out error messages to stderr, and then return an error object. Not sure if that's the right thing to do, but at least it seems practical. http://reviews.llvm.org/D10129 llvm-svn: 238714
* COFF: Add /alternatename option.Rui Ueyama2015-05-311-0/+21
| | | | | | | | | | | | | Previously, this feature was implemented using a special type of undefined symbol, in addition to an intricate way to make the resolver read a virtual file containing that renaming symbols. Now the feature is directly handled by the symbol table. The symbol table has a function, rename(), to rename symbols, whose definition is 4 lines long. Symbol renaming is naturally modeled using Symbol and SymbolBody. llvm-svn: 238696
* COFF: Detect file type by file magic.Rui Ueyama2015-05-311-4/+9
| | | | llvm-svn: 238691
* COFF: Make the Driver own all MemoryBuffers. NFC.Rui Ueyama2015-05-311-7/+27
| | | | | | | | | | | Previously, a MemoryBuffer of a file was owned by each InputFile object. This patch makes the Driver own all of them. InputFiles now have only MemoryBufferRefs. This change simplifies ownership managment (particularly for ObjectFile -- the object owned a MemoryBuffer only when it's not created from an archive file, because in that case a parent archive file owned the entire buffer. Now it owns nothing unconditionally.) llvm-svn: 238690
* COFF: /libpath should not take precedence over the current directory.Rui Ueyama2015-05-311-3/+5
| | | | llvm-svn: 238683
* COFF: Add /libpath option.Rui Ueyama2015-05-311-0/+5
| | | | llvm-svn: 238682
* COFF: Add /include option.Rui Ueyama2015-05-311-1/+8
| | | | | | | | | It does not involve notions of virtual archives or virtual files, nor store a list of undefined symbols somewhere else to consume them later. We did that before. In this patch, undefined symbols are just added to the symbol table, which now can be done in very few lines of code. llvm-svn: 238681
* COFF: Add /nodefaultlib option.Rui Ueyama2015-05-311-23/+52
| | | | llvm-svn: 238679
* COFF: Refactor functions to find files from search paths.Rui Ueyama2015-05-311-2/+54
| | | | llvm-svn: 238678
* COFF: Create LinkerDriver class.Rui Ueyama2015-05-311-8/+20
| | | | | | | | Previously the main linker routine is just a non-member function. We store some context information to the Config object. This patch makes it belong to Driver. llvm-svn: 238677
* COFF: Implement subsystem inference.Rui Ueyama2015-05-311-0/+20
| | | | llvm-svn: 238668
* COFF: Infer entry symbol name if /entry is not given.Rui Ueyama2015-05-311-0/+14
| | | | | | | | | | `main` is not the only main function in Windows. You can choose one from these four -- {w,}{WinMain,main}. There are four different entry point functions for them, {w,}{WinMain,main}CRTStartup, respectively. The linker needs to choose the right one depending on which `main` function is defined. llvm-svn: 238667
* COFF: Add /subsystem option.Rui Ueyama2015-05-291-0/+10
| | | | llvm-svn: 238571
* COFF: Add /version option.Rui Ueyama2015-05-291-0/+9
| | | | llvm-svn: 238570
* COFF: Add /heap option.Rui Ueyama2015-05-291-0/+9
| | | | llvm-svn: 238569
* Add /stack option.Rui Ueyama2015-05-291-1/+10
| | | | llvm-svn: 238568
* COFF: Add /base option.Rui Ueyama2015-05-291-0/+8
| | | | llvm-svn: 238567
* COFF: Add /help option.Rui Ueyama2015-05-291-0/+6
| | | | llvm-svn: 238565
* COFF: Add /machine option.Rui Ueyama2015-05-291-0/+12
| | | | llvm-svn: 238564
* COFF: Split Driver.cpp to Driver.cpp and DriverUtils.cpp. NFC.Rui Ueyama2015-05-281-123/+14
| | | | | | | | The previous implementation's driver file is cluttered by lots of small functions, and it was hard to find important functions. Make a separate file to prevent that issue. llvm-svn: 238482
* COFF: Add a new PE/COFF port.Rui Ueyama2015-05-281-0/+245
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
OpenPOWER on IntegriCloud