summaryrefslogtreecommitdiffstats
path: root/lld/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* ELF: Fix a bug in -l.Rui Ueyama2015-01-301-1/+1
| | | | | | | If a linker script is given with -l, LLD failed to read the file. The bug was introduced in 227341. llvm-svn: 227610
* Wrap debug output with DEBUG().Rui Ueyama2015-01-302-2/+2
| | | | llvm-svn: 227590
* Remove useless DEBUG_WITH_TYPE.Rui Ueyama2015-01-302-6/+2
| | | | | | | We have a DEBUG_TYPE macro for the same debug string already at the beginning of the file. llvm-svn: 227551
* Replace SimpleFileWrapper with a function.Rui Ueyama2015-01-302-3/+4
| | | | | | | | | | | | | | SimpleFileWrapper was a class to wrap an existing (possibly non-mutable) file as a mutable file. We used instances of the class in RoundTrip* passes, because the passes convert mutable files to non-mutable files, and we needed to convert them back to mutable. That feature can be implemented without defining a new class. Generally speaking, if we can implement a feature without defining a class and using only public interface of exsiting classes, that's preferred way to do that. And this is the case. llvm-svn: 227549
* Remove unused parameter.Rui Ueyama2015-01-302-2/+2
| | | | llvm-svn: 227536
* Remove remaining code for PPC ELF target.Rui Ueyama2015-01-304-10/+1
| | | | llvm-svn: 227534
* Remove unused #includes.Rui Ueyama2015-01-301-3/+0
| | | | llvm-svn: 227526
* ELF: Check StringRef::getAsInteger's return value.Rui Ueyama2015-01-291-7/+6
| | | | | | | getAsInteger may partially update its result argument. We need to check function return value to handle errors reliably. llvm-svn: 227510
* Add an assert to check atom ordinal.Rui Ueyama2015-01-291-0/+1
| | | | | | | No two atoms are allowed to have the same file and atom ordinals. If there's such atoms, there's a bug in the reader. llvm-svn: 227504
* ELF: Remove dead code.Rui Ueyama2015-01-291-7/+6
| | | | | | | _runLayoutPass is always true. No way to set a new value to the member variable. llvm-svn: 227501
* PECOFF: Do not use LayoutPass and instead use simpler one.Rui Ueyama2015-01-292-15/+30
| | | | | | | | | | | | | | | | | | | | | | | | The LayoutPass is one of the slowest pass. This change is to skip that pass. This change not only improve performance but also improve maintainability of the code because the LayoutPass is pretty complex. Previously we used the LayoutPass to sort all atoms in a specific way, and reorder them again for PE/COFF in GroupedSectionPass. I spent time on improving and fixing bugs in the LayoutPass (e.g. r193029), but the pass is still hard to understand and hard to use. It's better not to depend on that if we don't need. For PE/COFF, we just wanted to sort atoms in the same order as the file order in the command line. The feature we used in the LayoutPass is now simplified to compareByPosition function in OrderPass.cpp. The function is just 5 lines. This patch changes the order of final output because it changes the sort order a bit. The output is still correct, though. llvm-svn: 227500
* Fix MSVC C4060 warning (switch statement contains no case or default).Rui Ueyama2015-01-291-2/+0
| | | | llvm-svn: 227410
* ELF: s/diagnostics/diag/Rui Ueyama2015-01-281-33/+27
| | | | | | | We use a variable name "diag" in many other places and I think it's preferred because of its length. llvm-svn: 227369
* ELF: add a unit test for --as-needed.Rui Ueyama2015-01-281-1/+3
| | | | llvm-svn: 227367
* Add a unit test for LinkerScript.Rui Ueyama2015-01-281-13/+21
| | | | llvm-svn: 227341
* Remove PPC ELF targetGreg Fitzgerald2015-01-2813-351/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D7225 llvm-svn: 227320
* [Mips] Fix enumeral and non-enumeral type in conditional expression warningSimon Atanasyan2015-01-281-1/+1
| | | | | | No functional changes. llvm-svn: 227297
* Remove kindInGroup reference.Rui Ueyama2015-01-273-81/+0
| | | | | | | | | | | | That kind of reference was used only in ELFFile, and the use of that reference there didn't seem to make sense. All test still pass (after adjusting symbol names) without that code. LLD is still be able to link LLD and Clang. Looks like we just don't need this. http://reviews.llvm.org/D7189 llvm-svn: 227259
* [Mips] Remove unused function argumentSimon Atanasyan2015-01-271-4/+4
| | | | | | No functional changes. llvm-svn: 227245
* [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
* Accept -allow-shlib-undefined in addition to --allow-shlib-undefined.Rui Ueyama2015-01-261-1/+1
| | | | | | GNU LD accepts both. CMake seems to use the former than the latter. llvm-svn: 227144
* Fix shared library buildGreg Fitzgerald2015-01-262-3/+5
| | | | | | | | | * Removed cyclic dependency between lldPECOFF and lldDriver * Added missing dependencies in unit tests Differential Revision: http://reviews.llvm.org/D7185 llvm-svn: 227134
* Use parallel_sort in the LayoutPass.Rui Ueyama2015-01-261-1/+2
| | | | | | | | | | Time to link lld using lld improved from 5.7s to 5.4s on Windows. It's not a significant improvement but not bad for one-line change. This patch includes a bug fix for Parallel.h as the original code uses operator< instead of a compare function there. llvm-svn: 227132
* 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-2511-76/+137
| | | | | | | | | | | | 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
* Fix single-arch builds broken by r226976Greg Fitzgerald2015-01-241-0/+1
| | | | | | TODO: Move ELF/PPC to ELF/PowerPC TODO: Move ELF/X86_64 into ELF/X86 llvm-svn: 226989
* 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-2441-162/+150
| | | | | | | | | | 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
* Fix spelling.Rui Ueyama2015-01-231-1/+1
| | | | llvm-svn: 226966
* Remove extra parentheses.Rui Ueyama2015-01-231-1/+1
| | | | llvm-svn: 226965
* [MachO] Remove dependency on lldDriverGreg Fitzgerald2015-01-232-23/+21
| | | | | | | | | 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-2337-99/+162
| | | | | | This reverts commit 6a3f545b44cea46321e025d9ab773786af86cb51. llvm-svn: 226928
* Fix the ELF shared library build targetsGreg Fitzgerald2015-01-2337-162/+99
| | | | | | | | | | 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
* Don't use iterator for the same reason as r226883.Rui Ueyama2015-01-231-2/+3
| | | | llvm-svn: 226893
OpenPOWER on IntegriCloud