summaryrefslogtreecommitdiffstats
path: root/lld/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Make access to LinkingContext::getNode safe.Rui Ueyama2015-01-231-2/+5
| | | | llvm-svn: 226883
* Add ARM backend to the autotools buildGreg Fitzgerald2015-01-221-1/+2
| | | | | From: Greg Fitzgerald <garious@gmail.com> llvm-svn: 226782
* Fix five of the shared library build targetsGreg Fitzgerald2015-01-2127-34/+37
| | | | | | | | | | | | | | | | | | Before this patch there was a cyclic dependency between lldCore and lldReaderWriter. Only lldConfig could be built as a shared library. * Moved Reader and Writer base classes into lldCore. * The following shared libraries can now be built: lldCore lldYAML lldNative lldPasses lldReaderWriter Differential Revision: http://reviews.llvm.org/D7105 From: Greg Fitzgerald <garious@gmail.com> llvm-svn: 226732
* Fix runtime error on Windows.Rui Ueyama2015-01-211-2/+2
| | | | | | | | I believe the original code is valid, but on Windows it failed with an assertion error saying "Expression: vector iterator is not decrementable." Don't use rbegin and rend to workaround that error. llvm-svn: 226706
* add_lld_library -> add_llvm_libraryGreg Fitzgerald2015-01-2117-133/+85
| | | | | | | | | | | * Works better for shared libraries (sets PRIVATE instead of INTERFACE) * Fixes http://llvm.org/bugs/show_bug.cgi?id=22269 * Also, use build-target names instead of component names Differential Revision: http://reviews.llvm.org/D7074 From: Greg Fitzgerald <garious@gmail.com> llvm-svn: 226702
* Simplify.Rui Ueyama2015-01-211-8/+10
| | | | | | | What we are trying to do here is to skip object files in group if group is repeated. This code is simpler than before. llvm-svn: 226688
* [ELF] Minimal implementation for ARM static linkingGreg Fitzgerald2015-01-2120-0/+713
| | | | | | | | | | | | | | The code is able to statically link the simplest case of: int main() { return 0; } * Only works with ARM code - no Thumb code, no interwork (-marm -mno-thumb-interwork) * musl libc built with no interwork and no Thumb code Differential Revision: http://reviews.llvm.org/D6716 From: Denis Protivensky <dprotivensky@accesssoftek.com> llvm-svn: 226643
* Fix --start-group/end-group.Rui Ueyama2015-01-211-8/+8
| | | | | | | | | | | We used to manage the state whether we are in a group or not using a counter. The counter is incremented by one if we jump from end-group to start-group, and decremented by one if we don't. The counter was assumed to be either zero or one, but obviously it could be negative (if there's a group which is not repeated at all). This is a fix for that issue. llvm-svn: 226632
* Disable C4062 on Windows.Zachary Turner2015-01-201-0/+4
| | | | | | | | The use of std::future introduces an implicit dependency on the PPL subcomponent of ConcRT. ConcRT in general is pretty noisy with warnings, so this patch just disables one of the noisy warnings. llvm-svn: 226590
* Fix use after free.Rafael Espindola2015-01-201-1/+1
| | | | | | | This fixes running a few tests (including test/elf/Mips/e-flags-merge-1.test) under asan. llvm-svn: 226580
* ELF: Handle sh_addralign being set to zeroWill Newton2015-01-201-0/+3
| | | | | | | | sh_addralign of zero is equivalent to sh_addralign of one, meaning no alignment specified. Avoid calculating Log2 or modulus when sh_addralign is zero as the results will not be useful. llvm-svn: 226572
* ELF: Support detection of relocation errors during processingWill Newton2015-01-2019-55/+64
| | | | | | | | | | | At the moment errors in relocation processing such as out of range values are not detected or at best trapped by asserts which will not be present in release builds. This patch adds support for checking error return values from applyRelocation() calls and printing an appropriate error message. It also adds support for printing multiple errors rather than just the first one. llvm-svn: 226557
* Update comments.Rui Ueyama2015-01-173-6/+6
| | | | llvm-svn: 226380
* Add LLVM_LINK_COMPONENTS for the shared object buildGreg Fitzgerald2015-01-1614-1/+27
| | | | | | | Differential Revision: http://reviews.llvm.org/D7023 From: Greg Fitzgerald <garious@gmail.com> llvm-svn: 226346
* [PATCH] Speculatively instantiate archive membersRui Ueyama2015-01-163-7/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | LLD parses archive file index table only at first. When it finds a symbol it is looking for is defined in a member file in an archive file, it actually reads the member from the archive file. That's done in the core linker. That's a single-thread process since the core linker is single threaded. If your command line contains a few object files and a lot of archive files (which is quite often the case), LLD hardly utilizes hardware parallelism. This patch improves parallelism by speculatively instantiating archive file members. At the beginning of the core linking, we first create a map containing all symbols defined in all members, and each time we find a new undefined symbol, we instantiate a member file containing the symbol (if such file exists). File instantiation is side effect free, so this should not affect correctness. This is a quick benchmark result. Time to link self-link LLD executable: Linux 9.78s -> 8.50s (0.86x) Windows 6.18s -> 4.51s (0.73x) http://reviews.llvm.org/D7015 llvm-svn: 226336
* PE/COFF: rework how we handle base relocationsSaleem Abdulrasool2015-01-161-51/+59
| | | | | | | | | | | | | Generalise the base relocation handling slightly to support multiple base relocation types in PE/COFF. This is necessary to generate proper executables for WoA. Track the base relocation type from the decision that we need a base relocation to the point where we emit the base relocation into base relocation directory. Remove an outdated TODO item while in the area. llvm-svn: 226335
* Move common code to base class.Rui Ueyama2015-01-162-40/+0
| | | | llvm-svn: 226329
* Remove duplication code.Rui Ueyama2015-01-162-52/+0
| | | | llvm-svn: 226321
* [PECOFF] Remove ResolvableSymbols to simplify.Rui Ueyama2015-01-164-46/+36
| | | | | | | | | | | We had such class there because of InputGraph abstraction. Previously, no one except InputGraph itself has complete picture of input file list. In order to create a set of all defined symbols, we had to use some indirections there to workaround InputGraph. It can now be rewritten as simple code. No change in functionality. llvm-svn: 226319
* Split a function for readability.Rui Ueyama2015-01-161-26/+30
| | | | llvm-svn: 226292
* Simplify. No functionality change.Rui Ueyama2015-01-161-9/+4
| | | | llvm-svn: 226287
* [PECOFF] Improve parallelism.Rui Ueyama2015-01-161-8/+10
| | | | llvm-svn: 226284
* Run the resolver in parallel with the reader.Rui Ueyama2015-01-165-42/+34
| | | | | | | | | | | | | | | | | | | | This patch makes File::parse() multi-thread safe. If one thread is running File::parse(), other threads will block if they try to call the same method. File::parse() is idempotent, so you can safely call multiple times. With this change, we don't have to wait for all worker threads to finish in Driver::link(). Previously, Driver::link() calls TaskGroup::sync() to wait for all threads running File::parse(). This was not ideal because we couldn't start the resolver until we parse all files. This patch increase parallelism by making Driver::link() to not wait for worker threads. The resolver calls parse() to make sure that the file being read has been parsed, and then uses the file. In this approach, the resolver can run with the parser threads in parallel. http://reviews.llvm.org/D6994 llvm-svn: 226281
* [ELF] Add --as-needed.Rui Ueyama2015-01-165-5/+30
| | | | | | | | | | | | The previous default behavior of LLD is --as-needed. LLD linked against a DSO only if the DSO file was actually used to link an executable (i.e. at least one symbol was resolved using the shared library file.) In this patch I added a boolean flag to FileNode for --as-needed. I also added an accessor to DSO name to shared library file class. llvm-svn: 226274
* [ELF] Remove TargetHandler and DefaultTargetHandler constructorsSimon Atanasyan2015-01-168-21/+12
| | | | | | | These classes contain only abstract virtual functions. Explicit constructors are redundant. llvm-svn: 226265
* [ELF] Remove unused class fieldSimon Atanasyan2015-01-161-5/+1
| | | | | | No functional changes. llvm-svn: 226262
* [ELF] s/_context/_ctx/ and clang-format the codeSimon Atanasyan2015-01-161-9/+6
| | | | | | No functional changes. llvm-svn: 226261
* [ELF] Make the unhandledReferenceType() protected methodSimon Atanasyan2015-01-161-1/+2
| | | | | | No functional changes. llvm-svn: 226260
* [ELF] Make `TargetRelocationHandler` a regular non-template classSimon Atanasyan2015-01-169-26/+17
| | | | | | | This class defines a relocation handler interface. The interface does not depend on the template argument so the argument is redundant. llvm-svn: 226259
* [PPC] Remove redundant `virtual` keywordSimon Atanasyan2015-01-161-3/+3
| | | | | | No functional changes. llvm-svn: 226258
* [PPC] Remove unused class field PPCTargetRelocationHandler::_ppcTargetLayoutSimon Atanasyan2015-01-162-9/+3
| | | | | | No functional changes. llvm-svn: 226257
* [Mips] Use ELFLinkingContext class instead of MipsLinkingContext where possibleSimon Atanasyan2015-01-164-15/+12
| | | | | | No functional changes. llvm-svn: 226256
* [Mips] Make MipsLinkingContext owner of MipsELFFlagsMergerSimon Atanasyan2015-01-168-41/+32
| | | | | | | That reduce class dependencies and simplify the code a bit. No functional changes. llvm-svn: 226255
* [Mips] Remove redundant namespace namesSimon Atanasyan2015-01-161-29/+27
| | | | | | No functional changes. llvm-svn: 226254
* [Mips] Allow linking object files with MIPS32 and MIPS64 instructionsSimon Atanasyan2015-01-161-4/+56
| | | | | | | If object files satisfy O32 ABI they can be linked together even if some of them contains MIPS64 or MIPS64R2 instructions. llvm-svn: 226253
* PE/COFF: use dyn_cast for the check of the targetSaleem Abdulrasool2015-01-161-1/+1
| | | | | | | | | | The target may be a synthetic symbol like __ImageBase. cast_or_null will ensure that the atom is a DefinedAtom, which is not guaranteed, which was the original reason for the cast_or_null. Switch this to dyn_cast, which should enable building of executables for WoA. Unfortunately, the issue of missing base relocations still needs to be investigated. llvm-svn: 226246
* Use std::recursive_mutex instead of llvm's SmartMutex.Rui Ueyama2015-01-161-6/+5
| | | | llvm-svn: 226236
* Simplify.Rui Ueyama2015-01-153-14/+7
| | | | llvm-svn: 226225
* Simplify.Rui Ueyama2015-01-151-7/+5
| | | | llvm-svn: 226153
* [ELF] Do not error on non-existent file in the driver.Rui Ueyama2015-01-151-2/+4
| | | | | | | This change makes it easy to write unit tests for the GNU driver. No more "empty group" hack is needed. No change in functionality. llvm-svn: 226150
* Remove InputGraph and use std::vector<Node> instead.Rui Ueyama2015-01-158-55/+34
| | | | | | In total we have removed more than 1000 lines! llvm-svn: 226149
* Rename InputElement Node.Rui Ueyama2015-01-157-16/+16
| | | | | | | | | InputElement was named that because it's an element of an InputGraph. It's losing the origin because the InputGraph is now being removed. InputElement's subclass is FileNode, that naming inconsistency needed to be fixed. llvm-svn: 226147
* Remove InputGraph::addInputElement{,Front}.Rui Ueyama2015-01-156-15/+17
| | | | | | | | They were the last member functions of InputGraph (besides members()). Now InputGraph is just a container of a vector. We are ready to replace InputGraph with plain File vector. llvm-svn: 226146
* Remove WrapperNode.Rui Ueyama2015-01-156-18/+12
| | | | | | | WrapperNode was a useless subclass of FileNode. We should just use FileNode instead. llvm-svn: 226145
* Remove FileNode::parse.Rui Ueyama2015-01-153-32/+10
| | | | | | | FileNode::parse was just a forwarder to File::parse so we could remove that. Also removed dead code. llvm-svn: 226144
* Remove FileNode::getPath().Rui Ueyama2015-01-151-1/+1
| | | | | | | Previously both FileNode and File keep filename. This patch removed that redundancy. llvm-svn: 226143
* Remove InputGraph::size().Rui Ueyama2015-01-159-18/+10
| | | | llvm-svn: 226140
* Simplify FileNode.Rui Ueyama2015-01-151-3/+5
| | | | | | | | The member function was defined to allow subclasses to customize error message. But since we only have one FileNode type, there's no actual need for that. llvm-svn: 226139
* Merge SimpleFileNode with WrapperNode.Rui Ueyama2015-01-152-15/+13
| | | | llvm-svn: 226137
* [PECOFF] Remove an InputElement placeholder for the entry name.Rui Ueyama2015-01-152-10/+8
| | | | llvm-svn: 226133
OpenPOWER on IntegriCloud