summaryrefslogtreecommitdiffstats
path: root/lld/lib/Driver
Commit message (Collapse)AuthorAgeFilesLines
...
* [gnu-ld] Support -m on non-NetBSD targets.Michael J. Spencer2014-03-201-2/+0
| | | | llvm-svn: 204293
* [PECOFF] Fix link order.Rui Ueyama2014-03-141-20/+16
| | | | | | | | | | | | | | | | LLD fails to link symbol "_main" if the symbol is in a library file and the library file is given as a bare argument (i.e. not with /defaultlib option). It's because library files given as bare arguments are processed before other libraries given with /defaultlib, so when Linker finds msvcrtd needs a definition for "_main", the file providing the main function has already been processed and skipped. Linker don't revisit libraries if it's not given with /defaultlib. To fix it this patch change the way of command line handling; files end with ".lib" are treated as if they are given with /defaultlib. I don't believe it's 100% correct behavior but it's better than before. llvm-svn: 203892
* [PECOFF] Fix arguments passed to lib.exe.Rui Ueyama2014-03-141-1/+1
| | | | llvm-svn: 203891
* [PECOFF] Make WinLinkDriver::parse() and allocate*() functions thread-safe.Rui Ueyama2014-03-141-3/+15
| | | | | | Looks like a major cause of instability on Windows is this thread-safety bug. llvm-svn: 203889
* [PECOFF] Implement /lib option.Rui Ueyama2014-03-141-2/+30
| | | | | | This option is not documented and seems weird, but yeah we need it anyway. llvm-svn: 203884
* Use short identifier, s/diagnostics/diag/.Rui Ueyama2014-03-141-67/+62
| | | | llvm-svn: 203876
* [PECOFF] Support response files.Rui Ueyama2014-03-141-4/+66
| | | | | | | | If the driver finds a command line option in the form of "@filename", the option will be replaced with the content of the given file. It's an error if a response file cannot be read. llvm-svn: 203875
* Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-131-4/+4
| | | | | | | | This results in some simplifications to the code where an OwningPtr had to be used with the previous api and then ownership moved to a unique_ptr for the rest of lld. llvm-svn: 203809
* [Cleanup] Sort includes.Ahmed Charles2014-03-121-5/+5
| | | | llvm-svn: 203666
* [docs] Add list of missing GNU ld command line options.Michael J. Spencer2014-03-101-0/+107
| | | | llvm-svn: 203491
* [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-022-14/+14
| | | | 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-212-1/+2
| | | | | | | | | | | | | | | 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
* Fix trailing whitespace.Shankar Easwaran2014-01-272-2/+2
| | | | llvm-svn: 200182
* [ELF] Add Target specific Readers.Shankar Easwaran2014-01-271-1/+1
| | | | | | No change in functionality. llvm-svn: 200175
* [PECOFF] Support STACKSIZE module-definition file directive.Rui Ueyama2014-01-141-3/+11
| | | | llvm-svn: 199170
* [PECOFF] Support VERSION directive.Rui Ueyama2014-01-112-0/+28
| | | | 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-112-0/+47
| | | | llvm-svn: 199020
* [PECOFF] Add a helper function to read an integer from .def file.Rui Ueyama2014-01-111-12/+17
| | | | llvm-svn: 199019
* [PECOFF] Print a better error message for unknown module-definition file ↵Rui Ueyama2014-01-111-1/+1
| | | | | | directive. llvm-svn: 199018
* [PECOFF] Support HEAPSIZE directive.Rui Ueyama2014-01-112-2/+40
| | | | llvm-svn: 198994
* [PECOFF] Refactor module-defintion file parser.Rui Ueyama2014-01-112-20/+30
| | | | | | | | 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-104-2/+151
| | | | | | | | | | | | | 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
* Use getError instead of the error_code operator.Rafael Espindola2014-01-082-6/+6
| | | | llvm-svn: 198797
* [PECOFF] Simplify: Replace two-value enum with bool.Rui Ueyama2014-01-061-2/+2
| | | | llvm-svn: 198634
* Replace nested switch statements.Rui Ueyama2014-01-051-25/+26
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D2501 llvm-svn: 198535
* Use scoped enum.Rui Ueyama2014-01-031-2/+2
| | | | llvm-svn: 198396
* Add default search path if -nostdlib is not provided.Joerg Sonnenberger2014-01-022-5/+72
| | | | | | | Add basic emulation mapping for NetBSD/amd64, so that clang -m32 works as expected. llvm-svn: 198337
* [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] Do not accept "/include <string>" option.Rui Ueyama2013-12-261-1/+0
| | | | | | | | Command line argument separator on Windows is colon. We used to accept space as a separator, but we removed most of the code for that. This patch is to delete the remaining code. llvm-svn: 198032
* Fix copy/paste error.Joey Gouly2013-12-241-1/+1
| | | | llvm-svn: 197990
* [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
* [mach-o] add MachOLinkingContext::configure(type, arch, os)Nick Kledzik2013-12-211-49/+57
| | | | | | | | | It will configure resonable defaults for other settings in the MachOLinkingContext object based on the parameters. Patch by Joe Ranieri llvm-svn: 197851
* Restore vertical alignment lost by clang-formatNick Kledzik2013-12-201-4/+4
| | | | llvm-svn: 197834
* Run clang-format on r197727.Rui Ueyama2013-12-204-16/+12
| | | | llvm-svn: 197788
* Make SimpleFileNode inherit from FileNode.Joey Gouly2013-12-191-2/+2
| | | | | | This removes a lot of duplicated code. llvm-svn: 197751
* [lld] Introduce registry and Reference kind tupleNick Kledzik2013-12-196-47/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-122-0/+5
| | | | | | | | | | /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-092-0/+21
| | | | | | | | | | | | | | /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] Ignore /functionpadmin option.Rui Ueyama2013-12-041-0/+1
| | | | | | | | | If /functionpadmin is specified, the linker is supposed to make room at the beginning of each function, so that self-modifying program would easily hotpatch existing functions. Since I'm not sure if this feature is really used, I'll make LLD to ignore the option for now. llvm-svn: 196363
OpenPOWER on IntegriCloud