summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter
Commit message (Collapse)AuthorAgeFilesLines
...
* [Mips] Support R_MIPS_GPREL16 relocationSimon Atanasyan2015-01-273-10/+20
| | | | llvm-svn: 227244
* Use Reference::KindValue instead of uint16_t to pass and save a relocation kindSimon Atanasyan2015-01-272-16/+16
| | | | | | No functional changes. llvm-svn: 227233
* [ARM] Correctly use make_unhandled_reloc_errorDenis Protivensky2015-01-271-1/+1
| | | | llvm-svn: 227184
* [Mips] Fix createMipsRelocationHandler specialization (take 2)Denis Protivensky2015-01-271-2/+8
| | | | | | | | | | | Misread buildbot's log. Both gcc and clang compile this fine. Original fix reason: gcc allows template specializations only in the same namespace where template has been declared. llvm-svn: 227183
* Revert "[Mips] Fix createMipsRelocationHandler specialization"Denis Protivensky2015-01-271-8/+2
| | | | | | The buildbot reported build failures for clang. llvm-svn: 227179
* [Mips] Fix createMipsRelocationHandler specializationDenis Protivensky2015-01-271-2/+8
| | | | | | | gcc allows template specializations only in the same namespace where template has been declared. llvm-svn: 227177
* [lld] Correct forming of ARM/Thumb atomsDenis Protivensky2015-01-276-17/+150
| | | | | | | | | | | | Symbols addressing Thumb code have zero bit set in st_value to distinguish them from ARM instructions. This caused wrong atoms' forming because of offset of one byte brought in by that corrected st_value. Fixed reading of st_value & st_value-related things in ARMELFFile while forming atoms. Symbol table generation is also fixed for Thumb atoms. Differential Revision: http://reviews.llvm.org/D7161 llvm-svn: 227174
* Fix incorrect atom ordinal.Rui Ueyama2015-01-271-2/+3
| | | | | | | | Anonymous atoms created there were getting wrong atom ordinal. LayoutAfter references take precedence over atom ordinals, so the bug was not visible, though. llvm-svn: 227168
* Fix local variable names.Rui Ueyama2015-01-261-2/+3
| | | | llvm-svn: 227147
* Fix shared library buildGreg Fitzgerald2015-01-261-3/+4
| | | | | | | | | * Removed cyclic dependency between lldPECOFF and lldDriver * Added missing dependencies in unit tests Differential Revision: http://reviews.llvm.org/D7185 llvm-svn: 227134
* path.data() may return a non null terminated stringJean-Daniel Dupas2015-01-262-2/+2
| | | | | | and raw_fd_ostream constructor expects a StringRef. llvm-svn: 227081
* [Mips] Teach LLD to recognize one more MIPS target triple - mips64elSimon Atanasyan2015-01-2510-76/+134
| | | | | | | | | | | | This is initial patch to support MIPS64 object files linking. The patch just makes some classes more generalized, and rejects attempts to interlinking O32 and N64 ABI object files. I try to reuse the current MIPS target related classes as much as possible because O32 and N64 MIPS ABI are tightly related and share almost the same set of relocations, GOT, flags etc. llvm-svn: 227058
* [Mips] Make MipsELFObjectReader and MipsELFDSOReader class templatesSimon Atanasyan2015-01-252-10/+10
| | | | | | No functional changes. llvm-svn: 227051
* [Mips] Reformat the code with clang-formatSimon Atanasyan2015-01-251-2/+1
| | | | | | No functional changes. llvm-svn: 227049
* [Mips] Remove duplicated typedef'sSimon Atanasyan2015-01-252-4/+0
| | | | | | No functional changes. llvm-svn: 227048
* [Mips] Use template class argument instead of hard-coded type name inSimon Atanasyan2015-01-252-2/+2
| | | | | | | | the class field declarations. No functional changes. llvm-svn: 227047
* [ELF] Update for LLVM api changeSimon Atanasyan2015-01-251-2/+2
| | | | | | | | | The `Elf_Rel_Impl::setSymbolAndType` method now has the third argument `IsMips64EL` (like complement methods `getSymbol` and `getType`). While we do not support linking of MIPS64 ELF object file just pass `false` to the `setSymbolAndType`. llvm-svn: 227045
* Return a boolean value directly, instead of returning true if true and false ↵Rui Ueyama2015-01-241-4/+2
| | | | | | if false. llvm-svn: 226984
* Fix the ELF shared library build targets - take 2Greg Fitzgerald2015-01-2439-161/+124
| | | | | | | | | | lldELF is used by each ELF backend. lldELF's ELFLinkingContext also held a reference to each backend, creating a link-time cycle. This patch moves the backend references to lldDriver. Differential Revision: http://reviews.llvm.org/D7119 llvm-svn: 226976
* ELF: Remove dead code.Rui Ueyama2015-01-231-22/+0
| | | | llvm-svn: 226972
* ELF: Remove virtual from non-overriden functions.Rui Ueyama2015-01-232-38/+36
| | | | | | If it's overridden by a derived class, add override to the derived class. llvm-svn: 226971
* Remove extra parentheses.Rui Ueyama2015-01-231-1/+1
| | | | llvm-svn: 226965
* [MachO] Remove dependency on lldDriverGreg Fitzgerald2015-01-231-2/+20
| | | | | | | | | Moved getMemoryBuffer from DarwnLdDriver to MachOLinkingContext. lldMachO shared library target now builds. Differential Review: http://reviews.llvm.org/D7155 llvm-svn: 226963
* Revert " Fix the ELF shared library build targets"Greg Fitzgerald2015-01-2335-61/+161
| | | | | | This reverts commit 6a3f545b44cea46321e025d9ab773786af86cb51. llvm-svn: 226928
* Fix the ELF shared library build targetsGreg Fitzgerald2015-01-2335-161/+61
| | | | | | | | | | lldELF is used by each ELF backend. lldELF's ELFLinkingContext also held a reference to each backend, creating a link-time cycle. This patch moves the backend references to lldDriver. Differential Revision: http://reviews.llvm.org/D7119 llvm-svn: 226922
* Test commit.Denis Protivensky2015-01-231-1/+1
| | | | llvm-svn: 226903
* 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-2120-165/+22
| | | | | | | | | | | | | | | | | | 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
* add_lld_library -> add_llvm_libraryGreg Fitzgerald2015-01-2113-98/+61
| | | | | | | | | | | * 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
* [ELF] Minimal implementation for ARM static linkingGreg Fitzgerald2015-01-2119-0/+709
| | | | | | | | | | | | | | 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
* 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
* 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
* Add LLVM_LINK_COMPONENTS for the shared object buildGreg Fitzgerald2015-01-1611-1/+21
| | | | | | | Differential Revision: http://reviews.llvm.org/D7023 From: Greg Fitzgerald <garious@gmail.com> llvm-svn: 226346
* [PATCH] Speculatively instantiate archive membersRui Ueyama2015-01-162-5/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-161-26/+0
| | | | llvm-svn: 226321
* [PECOFF] Remove ResolvableSymbols to simplify.Rui Ueyama2015-01-163-44/+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
* Run the resolver in parallel with the reader.Rui Ueyama2015-01-162-2/+13
| | | | | | | | | | | | | | | | | | | | 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-163-0/+24
| | | | | | | | | | | | 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
OpenPOWER on IntegriCloud