summaryrefslogtreecommitdiffstats
path: root/lld/ELF/DriverUtils.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* ELF: Report multiple errors from the driver.Rui Ueyama2016-01-291-4/+3
| | | | | | | | | This patch let the driver keep going until it parses all command line options. http://reviews.llvm.org/D16645 llvm-svn: 259143
* ELF: Rename error -> fatal and redefine error as a non-noreturn function.Rui Ueyama2016-01-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In many situations, we don't want to exit at the first error even in the process model. For example, it is better to report all undefined symbols rather than reporting the first one that the linker picked up randomly. In order to handle such errors, we don't need to wrap everything with ErrorOr (thanks for David Blaikie for pointing this out!) Instead, we can set a flag to record the fact that we found an error and keep it going until it reaches a reasonable checkpoint. This idea should be applicable to other places. For example, we can ignore broken relocations and check for errors after visiting all relocs. In this patch, I rename error to fatal, and introduce another version of error which doesn't call exit. That function instead sets HasError to true. Once HasError becomes true, it stays true, so that we know that there was an error if it is true. I think introducing a non-noreturn error reporting function is by itself a good idea, and it looks to me that this also provides a gradual path towards lld-as-a-library (or at least embed-lld-to-your-program) without sacrificing code readability with lots of ErrorOr's. http://reviews.llvm.org/D16641 llvm-svn: 259069
* Remove unnecessary `lld::`.Rui Ueyama2016-01-061-5/+5
| | | | llvm-svn: 256970
* Update lld to match llvm r250901. OptTable constructor now takes an ↵Craig Topper2015-10-211-1/+1
| | | | | | ArrayRef. NFC llvm-svn: 250904
* [elf2] - remove redundant check.George Rimar2015-10-201-2/+0
| | | | | | This one is not needed anymore after r250812 llvm-svn: 250818
* [ELF2] Fixed crash when no library is specified for -lGeorge Rimar2015-10-201-0/+2
| | | | llvm-svn: 250811
* ELF2: Remove ArgParser class and define parseArgs() function instead.Rui Ueyama2015-10-111-3/+4
| | | | | | | ArgParser was a class with only one member function, so it didn't have to be a class. llvm-svn: 249988
* ELF2: LinkerScript: Interpret -l and = file name prefixes.Rui Ueyama2015-10-111-6/+13
| | | | | | | | In the linker script, -l and = have the same meaning as in the command line. In addition to that, if a path is not absolute, the path needs to be searched from the search paths. This patch implements them. llvm-svn: 249967
* ELF: Move utility functions from Driver to DriverUtils.Rui Ueyama2015-10-111-0/+35
| | | | llvm-svn: 249966
* ELF2: Manage BumpPtrAllocator ownership better.Rui Ueyama2015-10-111-2/+2
| | | | | | | | | | | | Previously, each ArgParser owned a BumpPtrAllocator, and arguments parsed by an ArgParser would refer strings allocated using the BumpPtrAllocator only when response files were used. This could cause a subtle bug because such ownership was not obvious. This patch moves the ownership from ArgParser to Driver and make the ownership explicit. llvm-svn: 249963
* ELF2: Create LinkerScript.cpp and move code from DriverUtils to there.Rui Ueyama2015-09-301-137/+0
| | | | llvm-svn: 248920
* ELF2: LinkerScript: Handle quoted tokens.Rui Ueyama2015-09-301-0/+12
| | | | llvm-svn: 248919
* ELF2: Add basic linker script support.Rui Ueyama2015-09-301-0/+125
| | | | | | | | | | | | | | | | This linker script parser and evaluator is powerful enough to read Linux's libc.so, which is (despite its name) a linker script that contains OUTPUT_FORMAT, GROUP and AS_NEEDED directives. The parser implemented in this patch is a recursive-descendent one. It does *not* construct an AST but consumes directives in place and sets the results to Symtab object, like what Driver is doing. This should be very fast since less objects are allocated, and this is also more readable. http://reviews.llvm.org/D13232 llvm-svn: 248918
* ELF2: Support reponse files.Rui Ueyama2015-09-251-1/+9
| | | | | | http://reviews.llvm.org/D13148 llvm-svn: 248575
* [ELF2] Output of all unknown arguments instead of only one.Rui Ueyama2015-09-241-2/+7
| | | | | | Patch from George Rimar! llvm-svn: 248524
* Move the error handling functions to Error.h. NFC.Rafael Espindola2015-08-061-0/+1
| | | | llvm-svn: 244216
* [ELF2] Add a new ELF linker based on the new PE/COFF linker.Michael J. Spencer2015-07-241-0/+63
| | | | | | Differential Revision: http://reviews.llvm.org/D11188 llvm-svn: 243161
* Revert ELF port. Posting to mailing list.Michael J. Spencer2015-07-141-121/+0
| | | | llvm-svn: 242118
* Initial ELF port.Michael J. Spencer2015-07-131-0/+121
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
OpenPOWER on IntegriCloud