summaryrefslogtreecommitdiffstats
path: root/lld/COFF/DriverUtils.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* COFF: Take reference to argument vector using std::vector::data() instead of ↵Peter Collingbourne2015-06-191-2/+2
| | | | | | | | | | operator[](0). This avoids undefined behaviour caused by an out-of-range access if the vector is empty, which can happen if an object file's directive section contains only whitespace. llvm-svn: 240183
* COFF: Allow identical alternatename options.Rui Ueyama2015-06-181-6/+5
| | | | | | | | Alternatename option is in the form of /alternatename:<from>=<to>. It is an error if there are two options having the same <from> but different <to>. It is *not* an error if both are the same. llvm-svn: 240075
* COFF: Handle /failifmismatch in the same manner as other options.Rui Ueyama2015-06-181-17/+13
| | | | | | No functionality change intended. llvm-svn: 240061
* COFF: Add /implib option.Rui Ueyama2015-06-181-3/+7
| | | | llvm-svn: 240045
* COFF: Handle /alternatename in .drectve section.Rui Ueyama2015-06-181-0/+19
| | | | llvm-svn: 240037
* COFF: Support /manifest{,uac,dependency,file} options.Rui Ueyama2015-06-181-1/+161
| | | | | | | | | | | | | | | The linker has to create an XML file for each executable. This patch supports that feature. You can optionally embed an XML file to an executable as .rsrc section. If you choose to do that (by passing /manifest:embed option), the linker has to create a textual resource file containing an XML file, compile that using rc.exe to a binary resource file, conver that resource file to a COFF file using cvtres.exe, and then link that COFF file. This patch implements that feature too. llvm-svn: 239978
* COFF: Simplify. NFC.Rui Ueyama2015-06-171-51/+50
| | | | | | Executor is a convenience class to run an external command. llvm-svn: 239945
* COFF: Create import library files.Rui Ueyama2015-06-171-0/+71
| | | | | | | | | | | | | | | | | | | | On Windows, we have to create a .lib file for each .dll. When linking against DLLs, the linker doesn't use the DLL files, but instead read a list of dllexported symbols from corresponding lib files. A library file containing descriptors of a DLL is called an import library file. lib.exe has a feature to create an import library file from a module-definition file. In this patch, we create a module-definition file and pass that to lib.exe. We eventually want to create an import library file by ourselves to eliminate dependency to lib.exe. For now, we just use the MSVC tool. llvm-svn: 239937
* COFF: Support creating DLLs.Rui Ueyama2015-06-171-0/+93
| | | | | | | | | | | | DLL files are in the same format as executables but they have export tables. The format of the export table is described in PE/COFF spec section 5.3. A new class, EdataContents, takes care of creating chunks for export tables. What we need to do is to parse command line flags for dllexports, and then instantiate the class to create chunks. For the writer, export table chunks are opaque data -- it just add chunks to .edata section. llvm-svn: 239869
* COFF: Support Windows resource files.Rui Ueyama2015-06-141-1/+40
| | | | | | | | | | | Resource files are data files containing i18n messages, icon images, etc. MSVC has a tool to convert a resource file to a regular COFF file so that you can just link that file to embed resources to an executable. However, you can directly pass resource files to the linker. If you do that, the linker invokes the tool automatically. This patch implements that feature. llvm-svn: 239704
* Update for llvm api change.Rafael Espindola2015-06-131-14/+2
| | | | llvm-svn: 239671
* COFF: Simplify. NFC.Rui Ueyama2015-06-071-5/+2
| | | | llvm-svn: 239270
* COFF: Use llvm::cl::ExpandReponseFiles.Rui Ueyama2015-06-071-17/+7
| | | | llvm-svn: 239269
* COFF: Support resonpse files.Rui Ueyama2015-06-071-3/+63
| | | | llvm-svn: 239242
* COFF: Add /failifmismatch option.Rui Ueyama2015-06-041-0/+24
| | | | llvm-svn: 239073
* COFF: Define an error category for the linker.Rui Ueyama2015-06-011-21/+30
| | | | | | | | | | | | | 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: Detect file type by file magic.Rui Ueyama2015-05-311-2/+0
| | | | llvm-svn: 238691
* COFF: Refactor functions to find files from search paths.Rui Ueyama2015-05-311-48/+0
| | | | llvm-svn: 238678
* COFF: Move machine type auto-detection to SymbolTable.Peter Collingbourne2015-05-291-25/+0
| | | | | | | | | The new mechanism is less code, and fixes the case where all inputs are archives. Differential Revision: http://reviews.llvm.org/D10136 llvm-svn: 238618
* COFF: Add /subsystem option.Rui Ueyama2015-05-291-0/+24
| | | | llvm-svn: 238571
* COFF: Add /version option.Rui Ueyama2015-05-291-0/+13
| | | | llvm-svn: 238570
* COFF: Add /base option.Rui Ueyama2015-05-291-0/+11
| | | | llvm-svn: 238567
* COFF: Add /help option.Rui Ueyama2015-05-291-0/+5
| | | | llvm-svn: 238565
* COFF: Add /machine option.Rui Ueyama2015-05-291-0/+41
| | | | llvm-svn: 238564
* COFF: Split Driver.cpp to Driver.cpp and DriverUtils.cpp. NFC.Rui Ueyama2015-05-281-0/+135
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
OpenPOWER on IntegriCloud