summaryrefslogtreecommitdiffstats
path: root/lld/lib/Driver/WinLinkDriver.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [Cleanup] Sort includes.Ahmed Charles2014-03-121-5/+5
| | | | llvm-svn: 203666
* [C++11] Add #include's for OwningPtr.Ahmed Charles2014-03-031-0/+1
| | | | | | Allows removing #include's in LLVM while switching to std::unique_ptr. llvm-svn: 202679
* [C++11] Work around an incompatibility between llvm::tie and std::tie.Benjamin Kramer2014-03-021-13/+13
| | | | llvm-svn: 202645
* Update for LLVM api change.Rafael Espindola2014-02-241-2/+2
| | | | llvm-svn: 202054
* Don't assume that F_None is the default. It is about to change.Rafael Espindola2014-02-241-2/+4
| | | | llvm-svn: 202039
* [PECOFF] Driver support for /SAFESEH option.Rui Ueyama2014-02-211-0/+1
| | | | | | | | | | | | | | | Syntactically /SAFESEH is a boolean flag -- you can pass /SAFESEH or /SAFESEH:no. The meaning of /SAFESEH is as follows. - If /SAFESEH is specified, the linker will produce an executable with SEH table. If any input files are not compatible with SEH, it's an error. - If /SAFESEH:no is specified, the linker will not emit SEH table even if all input files are compatible with SEH. - If no option is specified, the linker emits SEH table if all input files are compatible with SEH. llvm-svn: 201895
* [PECOFF] Add a TODO.Rui Ueyama2014-02-011-0/+3
| | | | llvm-svn: 200599
* [PECOFF] Handle /machine option before handling all the other options.Rui Ueyama2014-01-311-11/+13
| | | | | | | | The target machine type affects the meaning of other options, in particular how to mangle symbols. So we want to handle the option first and then parse all the other options. llvm-svn: 200589
* [PECOFF] Support VERSION directive.Rui Ueyama2014-01-111-0/+3
| | | | llvm-svn: 199022
* Make anonymous namespace as small as possible.Rui Ueyama2014-01-111-45/+53
| | | | llvm-svn: 199021
* [PECOFF] Support NAME directive.Rui Ueyama2014-01-111-0/+5
| | | | llvm-svn: 199020
* [PECOFF] Support HEAPSIZE directive.Rui Ueyama2014-01-111-0/+3
| | | | llvm-svn: 198994
* [PECOFF] Refactor module-defintion file parser.Rui Ueyama2014-01-111-10/+18
| | | | | | | | Refactor the parser so that the parser can return arbitrary type of parse result other than a vector of ExportDesc. Parsers for non-EXPORTS directives will be implemented in different patches. No functionality change. llvm-svn: 198993
* [PECOFF] Support module-definition file.Rui Ueyama2014-01-101-2/+27
| | | | | | | | | | | | | Module-definition (.def) files are the file containing linker directives, such as export symbols. Because link.exe supports the same features as command line options, just as some Linker Script commands overlaps with command line options, use of module-definition file is not really necessary. It provides an alternative way to specify some linker options. This patch implements EXPORTS directive. Other directives will be implemented in the future. llvm-svn: 198925
* [PECOFF] Simplify: Replace two-value enum with bool.Rui Ueyama2014-01-061-2/+2
| | | | llvm-svn: 198634
* Use scoped enum.Rui Ueyama2014-01-031-2/+2
| | | | llvm-svn: 198396
* [PECOFF] Change the DLL entry symbol.Rui Ueyama2013-12-271-1/+1
| | | | | | | | | I'm not 100% sure but it looks like DLL entry symbol (DLL initializer function name) should be _DllMainCRTStartup@12. The reason why I'm not very sure is because I have no idea what "@12" suffix is, but without it the symbol won't be resolved... llvm-svn: 198072
* Fix comment.Rui Ueyama2013-12-271-4/+4
| | | | llvm-svn: 198066
* [PECOFF] Fix /export option in the .drectve section.Rui Ueyama2013-12-241-0/+9
| | | | | | | /EXPORT option has slightly different semantics if it appears in the .drectve section. This patch implements it. llvm-svn: 197970
* [lld] Introduce registry and Reference kind tupleNick Kledzik2013-12-191-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main changes are in: include/lld/Core/Reference.h include/lld/ReaderWriter/Reader.h Everything else is details to support the main change. 1) Registration based Readers Previously, lld had a tangled interdependency with all the Readers. It would have been impossible to make a streamlined linker (say for a JIT) which just supported one file format and one architecture (no yaml, no archives, etc). The old model also required a LinkingContext to read an object file, which would have made .o inspection tools awkward. The new model is that there is a global Registry object. You programmatically register the Readers you want with the registry object. Whenever you need to read/parse a file, you ask the registry to do it, and the registry tries each registered reader. For ease of use with the existing lld code base, there is one Registry object inside the LinkingContext object. 2) Changing kind value to be a tuple Beside Readers, the registry also keeps track of the mapping for Reference Kind values to and from strings. Along with that, this patch also fixes an ambiguity with the previous Reference::Kind values. The problem was that we wanted to reuse existing relocation type values as Reference::Kind values. But then how can the YAML write know how to convert a value to a string? The fix is to change the 32-bit Reference::Kind into a tuple with an 8-bit namespace (e.g. ELF, COFFF, etc), an 8-bit architecture (e.g. x86_64, PowerPC, etc), and a 16-bit value. This tuple system allows conversion to and from strings with no ambiguities. llvm-svn: 197727
* [PECOFF] Export ordinal must be in the range 1 through 65535.Rui Ueyama2013-12-161-1/+4
| | | | llvm-svn: 197365
* [PECOFF] Parse /export optional arguments.Rui Ueyama2013-12-131-2/+43
| | | | | | | /EXPORT command line option can take an ordinal, NONAME flag, and DATA flag. This patch is to parse these optional arguments. llvm-svn: 197217
* [PECOFF] Parse /dll command line option.Rui Ueyama2013-12-121-0/+8
| | | | llvm-svn: 197123
* [PECOFF] Add /dllexport option.Rui Ueyama2013-12-121-0/+4
| | | | | | | | | | /DLLEXPORT is a command line option to export a symbol. __declspec(dllexport) uses that to make the linker to export DLLExport'ed functions, by adding the option to .drectve section. This patch implements the parser of the command line option. llvm-svn: 197122
* [PECOFF] Add /alternatename option parser.Rui Ueyama2013-12-091-0/+20
| | | | | | | | | | | | | | /ALTERNATENAME is a rarely-used, undocumented command line option that is needed to link LLD for release build. It seems that the option is for defining an weak alias; /alternatename:foo=bar defines weak symbol "foo" for "bar". If "foo" is defined in an input file, it'll be linked normally and the command line option will have no effect. If it's not defined, "foo" will be handled as an alias for "bar". This patch implements the parser for the option. The actual weak alias handling will be implemented in a separate patch. llvm-svn: 196743
* [PECOFF] Handle .lib files as if they are grouped by --{start,end}-group.Rui Ueyama2013-12-051-19/+45
| | | | | | | | | | | | | | Currently we do not de-duplicate library files specified by /defaultlib option. As a result, the same files are added multiple times to the input graph. In particular, some popular files, such as kernel32.lib or oldnames.lib, are added more than 10 times during linking of LLD. That makes the linker slower, as it needs to parse the same file again and again. This patch solves the issue by de-duplicating. The same file will be added only once to the input graph. This patch improved the LLD linking time from 10.5 seconds to 7.7 seconds on my 4-core Core i7 Macbook Pro. llvm-svn: 196504
* [PECOFF] Print input file names if /verbose is specified.Rui Ueyama2013-12-031-0/+4
| | | | llvm-svn: 196196
* [PECOFF] Make /subsystem option parser a separate function.Rui Ueyama2013-12-021-18/+29
| | | | llvm-svn: 196092
* [PECOFF] Fix /debug option.Rui Ueyama2013-12-011-3/+0
| | | | | | | /DEBUG option is to make the linker to emit debug information to the resulting executable. It's not for enable debugging of the linker itself. llvm-svn: 196040
* [PECOFF] Improve /merge option handling.Rui Ueyama2013-11-271-2/+2
| | | | | | | | | | | | | | | | | /MERGE option is a bit complicated for many reasons. Firstly, it takes both positive and negative arguments. That means we have to have one of three distinctive values (set, clear or unchange) for each permission bit. In this patch we represent the three values using two bitmasks. Secondly, the permissions specified by the parameter is bitwise or-ed with the default permissions of a section. There is an exception for that rule; if one of READ, WRITE or EXECUTE bit is specified, unspecified bits need to be cleared. (So if you specify only WRITE for example, the resulting section will not have WRITE nor EXECUTE bits.) Lastly, multiple /merge options are allowed. llvm-svn: 195882
* [PECOFF] Fix parameter mapping for /section.Rui Ueyama2013-11-261-6/+6
| | | | | | | The current mapping for /section one character options is really bogus. Map to the correct flags. llvm-svn: 195774
* [PECOFF] Do not set the entry address if /noentry option is given.Rui Ueyama2013-11-221-1/+7
| | | | | | | This is the first step towards DLL creation support. Resource-only DLLs don't have entry point address. llvm-svn: 195510
* [PECOFF] Move files with ".lib" extension to the end of the input file list.Rui Ueyama2013-11-211-2/+15
| | | | | | | | | It's allowed to specify library files *before* object files in the command line. Object files seems to be processed first, and then their undefined symbols are resolved from the libraries. This patch implements the compatible behavior. llvm-svn: 195295
* [PECOFF] Do not check if library is already added.Rui Ueyama2013-11-211-7/+3
| | | | llvm-svn: 195289
* Rename allocateString -> allocate.Rui Ueyama2013-11-211-13/+13
| | | | llvm-svn: 195284
* Move member functions to its own cpp file.Rui Ueyama2013-11-201-14/+0
| | | | llvm-svn: 195281
* [PECOFF] Avoid using statically initialized std::vector.Rui Ueyama2013-11-151-4/+8
| | | | | | Also slightly reduces PECOFFLinkingContext's memory footprint (~128B). llvm-svn: 194787
* [PECOFF] Add /stub option.Rui Ueyama2013-11-151-0/+19
| | | | llvm-svn: 194757
* Re-submit r194551: Use empty() instead of size() == 0.Rui Ueyama2013-11-131-1/+1
| | | | llvm-svn: 194556
* Revert "Use empty() instead of size() == 0."Rui Ueyama2013-11-131-1/+1
| | | | | | This reverts commit r194551 because it broke the buildbot. llvm-svn: 194552
* Use empty() instead of size() == 0.Rui Ueyama2013-11-131-1/+1
| | | | llvm-svn: 194551
* [PECOFF] Fix use-after-return.Rui Ueyama2013-11-131-4/+6
| | | | llvm-svn: 194545
* [PECOFF] Rename getSectionAlignment -> getSectionDefaultAlignment.Rui Ueyama2013-11-061-1/+1
| | | | | | | | These fields are for /align option. Section alignment can be set per-section basis with /section option too. In order to avoid name conflicts, rename the existing identifiers to become more specific. No functionality change. llvm-svn: 194160
* [PECOFF] Add /section option.Rui Ueyama2013-11-061-0/+70
| | | | | | | | | | | /section command line option is to set/reset attributes of the Characteristics field in the section header. You can set non-default values with this option. You can make .data section executable with this, for example. This patch implements the parser of the command line option. The code to use the parsed values will be committed in a separate patch. llvm-svn: 194133
* [PECOFF] Do not expose _noDefaultLibs. No functionality change.Rui Ueyama2013-11-061-2/+1
| | | | llvm-svn: 194130
* [PECOFF] Do not add the same library to the input graph more than once.Rui Ueyama2013-11-061-7/+11
| | | | | | | | /defaultlib options can be specified implicitly via the .drectve section, and it's pretty common that multiple object files add the same library, such as user32.lib, to the input. We shouldn't add the same library multiple times. llvm-svn: 194129
* [PECOFF] Report error if there's unknown flag in .drectveRui Ueyama2013-11-051-2/+2
| | | | | | Errors in .drectve section were silently ignored. This patch fixes the issue. llvm-svn: 194110
* Remove redundant std::move().Rui Ueyama2013-11-011-3/+3
| | | | llvm-svn: 193883
* [PECOFF] File extension is case-insensitive on Windows.Rui Ueyama2013-10-311-2/+2
| | | | llvm-svn: 193797
* Use StringRef::startswith_lower().Rui Ueyama2013-10-301-17/+9
| | | | llvm-svn: 193712
OpenPOWER on IntegriCloud