summaryrefslogtreecommitdiffstats
path: root/lld/COFF/InputFiles.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* COFF: include archive name in LTO object nameBob Haarman2017-03-281-2/+2
| | | | | | | | | | | | | | Summary: In the ELF linker, we create the buffer identifier for bitcode files by appending the object name to the archive name. This change makes the COFF linker do the same. Without the change, ThinLTO builds can fail with an error message about multiple ThinLTO modules per object file, caused by object files contained in different archives having the same name. Reviewers: pcc, ruiu Reviewed By: pcc Subscribers: mehdi_amini Differential Revision: https://reviews.llvm.org/D31402 llvm-svn: 298942
* refactor COFF linker to use new LTO APIBob Haarman2017-02-021-43/+54
| | | | | | | | | | | | | | Summary: The COFF linker previously implemented link-time optimization using an API which has now been marked as legacy. This change refactors the COFF linker to use the new LTO API, which is also used by the ELF linker. Reviewers: pcc, ruiu Reviewed By: pcc Subscribers: mgorny, mehdi_amini Differential Revision: https://reviews.llvm.org/D29059 llvm-svn: 293967
* Remove unused 'using' declaration. Found by clang-tidy: ↵Sylvestre Ledru2017-01-281-2/+0
| | | | | | misc-unused-using-decls NFC llvm-svn: 293380
* Merge elf::toString and coff::toString.Rui Ueyama2017-01-061-4/+3
| | | | | | The two overloaded functions hid each other. This patch merges them. llvm-svn: 291222
* Remove lld/Support/Memory.h.Rui Ueyama2016-12-181-3/+3
| | | | | | | | | | | | I thought for a while about how to remove it, but it looks like we can just copy the file for now. Of course I'm not happy about that, but it's just less than 50 lines of code, and we already have duplicate code in Error.h and some other places. I want to solve them all at once later. Differential Revision: https://reviews.llvm.org/D27819 llvm-svn: 290062
* COFF: Open and map input files asynchronously on Windows.Peter Collingbourne2016-12-151-24/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Profiling revealed that the majority of lld's execution time on Windows was spent opening and mapping input files. We can reduce this cost significantly by performing these operations asynchronously. This change introduces a queue for all operations on input file data. When we discover that we need to load a file (for example, when we find a lazy archive for an undefined symbol, or when we read a linker directive to load a file from disk), the file operation is launched using a future and the symbol resolution operation is enqueued. This implies another change to symbol resolution semantics, but it seems to be harmless ("ninja All" in Chromium still succeeds). To measure the perf impact of this change I linked Chromium's chrome_child.dll with both thin and fat archives. Thin archives: Before (median of 5 runs): 19.50s After: 10.93s Fat archives: Before: 12.00s After: 9.90s On Linux I found that doing this asynchronously had a negative effect on performance, probably because the cost of mapping a file is small enough that it becomes outweighed by the cost of managing the futures. So on non-Windows platforms I use the deferred execution strategy. Differential Revision: https://reviews.llvm.org/D27768 llvm-svn: 289760
* COFF: Use a DenseSet instead of a map to atomic_flag to track which archive ↵Peter Collingbourne2016-12-121-11/+1
| | | | | | | | members have been read. Differential Revision: https://reviews.llvm.org/D27667 llvm-svn: 289414
* COFF: New symbol table design.Peter Collingbourne2016-12-091-36/+60
| | | | | | | | | This ports the ELF linker's symbol table design, introduced in r268178, to the COFF linker. Differential Revision: http://reviews.llvm.org/D21166 llvm-svn: 289280
* COFF: Move a call to toString() out of the hot path.Peter Collingbourne2016-12-091-2/+4
| | | | | | | | | Profiling revealed that we were spending 5% of our time linking chrome_child.dll just in this call to toString(). Differential Revision: https://reviews.llvm.org/D27628 llvm-svn: 289270
* Remove unnecessary `llvm::`.Rui Ueyama2016-12-081-3/+3
| | | | llvm-svn: 289102
* Revert r289084: Start using make() in COFF.Rui Ueyama2016-12-081-7/+10
| | | | | | This reverts commit r289084 to appease buildbots. llvm-svn: 289086
* Start using make() in COFF.Rui Ueyama2016-12-081-10/+7
| | | | | | We don't want ELF and COFF to diverge too much. llvm-svn: 289085
* COFF: Define overloaded toString functions.Rui Ueyama2016-12-071-26/+28
| | | | | | | | | | | | | Previously, we had different way to stringize SymbolBody and InputFile to construct error messages. This patch defines overloaded function toString() so that we don't need to memorize all these different function names. With that change, it is now easy to include demangled names in error messages. Now, if there is a symbol name conflict, we'll print out both mangled and demangled names. llvm-svn: 288992
* Do plumbing work for CodeView debug info.Rui Ueyama2016-11-211-5/+20
| | | | | | | | | | Previously, we discarded .debug$ sections. This patch adds them to files so that PDB.cpp can access them. This patch also adds a debug option, /dumppdb, to dump debug info fed to createPDB so that we can verify that valid data has been passed. llvm-svn: 287555
* Prevent at compile time converting from Error::success() to Expected<T>Mehdi Amini2016-11-111-1/+1
| | | | | | | | This would trigger an assertion at runtime otherwise. Differential Revision: https://reviews.llvm.org/D26482 llvm-svn: 286562
* Create PDB.h and move code to remove unnecessary #includes.Rui Ueyama2016-09-151-0/+5
| | | | llvm-svn: 281670
* lld-link: Include the name of bad input files in several "input file is bad" ↵Nico Weber2016-08-031-7/+7
| | | | | | | | | | diagnostics. Also change a few getName() calls to getShortName() calls. https://reviews.llvm.org/D23123 Part of PR28553. llvm-svn: 277616
* Revert an unintentional change from r277599Nico Weber2016-08-031-7/+7
| | | | llvm-svn: 277600
* Revert 277594, it caused PR28827Nico Weber2016-08-031-7/+7
| | | | llvm-svn: 277599
* COFF: Implement /linkrepro flag.Peter Collingbourne2016-07-261-3/+11
| | | | | | | | | | | | | | | | This flag is implemented similarly to --reproduce in the ELF linker. This patch implements /linkrepro by moving the cpio writer and associated utility functions to lldCore, and using that implementation in both linkers. One COFF-specific detail is that we store the object file from which the resource files were created in our reproducer, rather than the resource files themselves. This allows the reproducer to be used on non-Windows systems for example. Differential Revision: https://reviews.llvm.org/D22418 llvm-svn: 276719
* COFF: Update error messages so that they start with lowercase letters.Rui Ueyama2016-07-151-7/+7
| | | | llvm-svn: 275513
* Make check() always return a value.Rui Ueyama2016-07-151-25/+12
| | | | | | | Previously, one of two check functions didn't return a value. It was confusing. This patch makes both functions return values. llvm-svn: 275511
* COFF: Remove `void error()` functions and use fatal instead.Rui Ueyama2016-07-151-15/+19
| | | | | | This change makes the control flow more explicit. llvm-svn: 275504
* COFF: Remove unnecessary explicit calls of Twine ctor.Rui Ueyama2016-07-141-9/+9
| | | | llvm-svn: 275501
* COFF: Rename noreturn error -> fatal.Rui Ueyama2016-07-141-5/+5
| | | | | | This new name is also consistent with ELF. llvm-svn: 275500
* COFF: Rename non-noreturn error -> check.Rui Ueyama2016-07-141-9/+9
| | | | | | The new name is consistent with ELF. llvm-svn: 275499
* COFF: Update remaining #include paths.Peter Collingbourne2016-07-141-1/+1
| | | | llvm-svn: 275480
* [lld] Update LLD for Archive::child_iterator change in LLVM r275361.Lang Hames2016-07-141-4/+3
| | | | llvm-svn: 275362
* Matching change for lld for the llvm change of Archive::create() from ↵Kevin Enderby2016-06-291-1/+2
| | | | | | ErrorOr<...> to Expected<...> in r274160. llvm-svn: 274161
* Fix Clang-tidy misc-unused-using-decls and Include What You Use warnings.Eugene Zelenko2016-04-211-5/+15
| | | | | | Differential revision: http://reviews.llvm.org/D19348 llvm-svn: 267008
* LTO: Adapt to LLVM API changes in r266713Duncan P. N. Exon Smith2016-04-191-1/+1
| | | | llvm-svn: 266714
* LTO: Merge debug info types when linking bitcodeDuncan P. N. Exon Smith2016-04-171-0/+1
| | | | | | | Make sure lld enables ODR type uniquing for debug info when invoking LTO, as a follow-up to LLVM r266549. llvm-svn: 266555
* Do not use llvm::getGlobalContext().Rui Ueyama2016-04-141-3/+3
| | | | llvm-svn: 266375
* Revert "Do not use llvm::getGlobalContext(), trying to nuke it from LLVM"Mehdi Amini2016-04-141-2/+1
| | | | | | | | This reverts commit r266365 and r266367, the contexts in the two places have to match. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266373
* Use fully qualified name to refer to LLVMContextMehdi Amini2016-04-141-1/+1
| | | | | From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266367
* Do not use llvm::getGlobalContext(), trying to nuke it from LLVMMehdi Amini2016-04-141-1/+2
| | | | | From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266365
* Needed change to lld for the change to createBinary() now returning ↵Kevin Enderby2016-04-061-1/+3
| | | | | | | | | Expected<...> With the llvm change in r265606 this is the matching needed change to the lld code now that createBinary() is returning Expected<...> . llvm-svn: 265607
* [COFF] Remove undefined behavior from ObjectFile::createWeakExternalDavid Majnemer2016-03-201-14/+7
| | | | | | | | | | | | | | | LLD type-punned an integral type and a pointer type using a pointer field. This is problematic because the pointer type has alignment greater than some of the integral values. This would be less problematic if a union was used but it turns out the integral values are only present for a short, transient, amount of time. Let's remove this undefined behavior by skipping the punning altogether by storing the state in a separate memory location: a vector which informs us which symbols to process for weak externs. llvm-svn: 263918
* [COFF] Don't trust a symbol's section numberDavid Majnemer2016-03-151-2/+12
| | | | | | | | | This fixes a test which exposed an ASan issue. We assumed that a symbol's section number had a corresponding section without performing validation. llvm-svn: 263558
* COFF: Rename RoundUpToAlignment -> align.Rui Ueyama2016-01-081-1/+0
| | | | llvm-svn: 257220
* Update for llvm change.Rafael Espindola2015-12-041-6/+6
| | | | llvm-svn: 254725
* These are the matching changes needed to the lld project for the changes to llvmKevin Enderby2015-11-051-1/+4
| | | | | | | in r252192 that changed the Archive and Child interfaces in libObject. These include Rafael Espindola’s many suggested updates. llvm-svn: 252193
* Don't implicitly construct an Archive::child_iterator.Rafael Espindola2015-11-051-6/+5
| | | | llvm-svn: 252166
* COFF: Fix thread-safety bug.Rui Ueyama2015-09-191-0/+5
| | | | | | LTOModule doesn't seem to be thread-safe, so guard that with mutex. llvm-svn: 248102
* COFF: Corrected error message if a section failed to load.Rui Ueyama2015-09-131-2/+2
| | | | | | | | There is no sense to use Name in these lines as it is not initialized yet. Patch from Igor Kudrin! llvm-svn: 247531
* COFF: Use section content checksum for ICF.Rui Ueyama2015-09-041-1/+2
| | | | | | | | | Previously, we calculated our own hash values for section contents. Of coruse that's slow because we had to access all bytes in sections. Fortunately, COFF objects usually contain hash values for COMDAT sections. We can use that to speed up Identical COMDAT Folding. llvm-svn: 246869
* Remove an allocator which was used for just one allocation.Rafael Espindola2015-09-021-3/+1
| | | | llvm-svn: 246662
* COFF: Preserve original spelling of DLL file name.Rui Ueyama2015-09-021-1/+1
| | | | | | | | | | | This patch fixes a subtle incompatibility with MSVC linker. MSVC linker preserves the original spelling of a DLL in the import descriptor table. LLD previously converted all characters to lowercase. Usually this difference is benign, but if a program explicitly checks for DLL file names, the program could fail. llvm-svn: 246620
* COFF: Use ErrorOr::operator* instead of ErrorOr::get.Rui Ueyama2015-08-181-4/+4
| | | | | | This patch is to make COFF coding style consistent with ELF. NFC. llvm-svn: 245282
* COFF: Do not handle __NULL_IMPORT_DESCRIPTOR differently than the other symbols.Rui Ueyama2015-08-181-7/+2
| | | | | | | | | | | __NULL_IMPORT_DESCRIPTOR is a symbol used by MSVC liner to construct the import descriptor table. We do not use the symbol. Previously, we had code to skip that symbol. That code does not actually do anything meaningful because no one is referencing the symbol, the symbol would naturally be ignored. This patch stops recognizing the symbol. llvm-svn: 245280
OpenPOWER on IntegriCloud