summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix code to deal with recent LLVM changes.Greg Clayton2016-11-111-2/+5
| | | | | | https://reviews.llvm.org/D26526 llvm-svn: 286598
* Prevent at compile time converting from Error::success() to Expected<T>Mehdi Amini2016-11-1118-80/+80
| | | | | | | | This would trigger an assertion at runtime otherwise. Differential Revision: https://reviews.llvm.org/D26482 llvm-svn: 286562
* Fix build breakage on buildbots that was due to 285309.Greg Clayton2016-10-271-3/+4
| | | | llvm-svn: 285321
* Fix Clang-tidy readability-redundant-member-init warnings; other minor fixesEugene Zelenko2016-10-251-13/+16
| | | | | | Differential revision: https://reviews.llvm.org/D25931 llvm-svn: 285086
* Adjust for TimePoint interface change in llvm: D25730. NFCPavel Labath2016-10-241-1/+1
| | | | llvm-svn: 284965
* Retire llvm::alignOf in favor of C++11 alignof.Benjamin Kramer2016-10-201-6/+3
| | | | | | No functionality change intended. llvm-svn: 284734
* [MachO] Factor out a fair amount of duplicated code. NFCI.Davide Italiano2016-09-121-26/+14
| | | | llvm-svn: 281260
* [MachO] Remove code accidentally cut'n'pasted 3 times.Davide Italiano2016-09-101-204/+0
| | | | | | | It wasn't harmful, just goofy. It's weird to see how this has fallen through the crack without anybody noticing for so long. llvm-svn: 281148
* Fix shared library build.Rafael Espindola2016-09-061-0/+1
| | | | llvm-svn: 280753
* Use the demangler in llvm.Rafael Espindola2016-09-061-7/+2
| | | | llvm-svn: 280733
* ReaderWriter: Use ilist_noalloc_traits for TrieEdge, NFCDuncan P. N. Exon Smith2016-09-031-8/+3
| | | | | | | Adopt r280128 in lld, specializing ilist_alloc_traits rather than reinventing the wheel. llvm-svn: 280566
* ADT: Remove uses of ilist_*sentinel_traits, NFCDuncan P. N. Exon Smith2016-08-221-4/+0
| | | | llvm-svn: 279458
* MachO: Use ilist_half_embedded_sentinel_traits, NFCDuncan P. N. Exon Smith2016-08-121-12/+4
| | | | | | | Use ilist_half_embedded_sentinel_traits for the list of lld::mach_o::normalized::TrieEdge, rather than duplicating the code. llvm-svn: 278523
* Dead strip DESC bits should only be set on object files.Pete Cooper2016-08-111-1/+2
| | | | | | It only makes sense to set on N_NO_DEAD_STRIP on a relocatable object file. Otherwise the bits aren't useful for anything. Matches the ld64 behaviour. llvm-svn: 278419
* Better compress lazy binding info to match ld64.Pete Cooper2016-08-111-8/+11
| | | | | | | | | We should be using one of BIND_OPCODE_SET_DYLIB_SPECIAL_IMM, BIND_OPCODE_SET_DYLIB_ORDINAL_IMM, and BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB depending on whether ordinals are <= 0, <= 15, > 15. This matches the behaviour of ld64. llvm-svn: 278407
* Generate slightly more compressed binding opcodes when entries are the same ↵Pete Cooper2016-08-111-12/+37
| | | | | | | | | | | | as last time. We already had logic for binding opcodes had the same addend as last time. This adds the cases where the ordinal, symbol name, type, and segment offsets are the same as the last emitted ordinal. This gets us one step closer to emitting rebase opcodes as compressed as ld64 can manage. llvm-svn: 278405
* Arm64 stubs alignment is 2, not 4.Pete Cooper2016-08-111-2/+2
| | | | | | This matches the behaviour of ld64 when looking at the alignment of the stubs section in the final image. llvm-svn: 278398
* Change when we choose to add an LC_LOAD_DYLIB to the final image.Pete Cooper2016-08-113-16/+17
| | | | | | | | | | | Currently we do this when an atom is used, but we need to do it when a dylib is referenced on the cmdline as this matches ld64. This fixes much confusion over which maps are indexed with installName vs path. There is likely other confusion so i'll be seeing if i can remove path() completely in a future commit as path() shouldn't really be needed by anyone. llvm-svn: 278396
* Fix off-by-one error in default currentVersion.Pete Cooper2016-08-111-2/+2
| | | | | | | | A version of 0x1000 is 0.16.0, not 1.0.0 as the comment said. Fix the value to match the comment, and also the one test case which had this wrong. llvm-svn: 278381
* [lld][MachO] Fix LC_SEGEMENT[_64] filesize computation in -r mode.Lang Hames2016-08-101-1/+3
| | | | | | | | | | Using vmsize to populate this file works when outputing MachO images, but fails when outputting relocatable objects. This patch fixes the computation to use file offsets, which works for both output types. Fixes <rdar://problem/27727666> llvm-svn: 278297
* The first string table entry should be a null terminated space, not just null.Pete Cooper2016-08-081-2/+5
| | | | | | | This matches the behaviour of ld64 which initializes the string table with ' ' then '\0'. lld only had the '\0' and needed the ' '. llvm-svn: 278071
* ExportTrie nodes need to be visisted in order.Pete Cooper2016-08-051-2/+30
| | | | | | | | The export trie was being emitted in the order the nodes were added to the vector, but instead needs to be visited in the order that the nodes are traversed. This matches the behaviour of ld64. llvm-svn: 277869
* Needed change to lld for the changes to libObject/Archive interfaces now ↵Kevin Enderby2016-08-031-5/+8
| | | | | | | | returning Expected<> for the llvm trunk change in r277656 llvm-svn: 277657
* [lld][MachO] Replace some std::string with char* buffers to eliminate mem leaks.Lang Hames2016-07-292-13/+15
| | | | | | | | | | | The MachO debug support code (committed in r276935) occasionally needs to allocate string copies, and was doing so by creating std::strings on a BumpPtrAllocator. The strings were untracked, so the destructors weren't being run and we were leaking the memory when the allocator was thrown away. Since it's easier than tracking the strings, this patch switches the copies to char buffers allocated directly in the bump-ptr allocator. llvm-svn: 277208
* Matching change needed to lld for llvm trunk change r277177.Kevin Enderby2016-07-291-3/+3
| | | | | | Where Archive::getMemoryBufferRef() was changed to return Expected<> llvm-svn: 277183
* [lld][MachO] Remove some debugging output code that was mistakenly left in inLang Hames2016-07-282-30/+0
| | | | | | r276935. llvm-svn: 276944
* [lld][MachO] Re-apply r276921 with fix - initialize strings for debug stringLang Hames2016-07-279-26/+863
| | | | | | copies. llvm-svn: 276935
* [lld][MachO] Temporarily revert r276921 - it's causing bot-failures on Linux.Lang Hames2016-07-279-862/+26
| | | | llvm-svn: 276928
* [lld][MachO] Add debug info support for MachO.Lang Hames2016-07-279-26/+862
| | | | | | | | | This patch causes LLD to build stabs debugging symbols for files containing DWARF debug info, and to propagate existing stabs symbols for object files built using '-r' mode. This enables debugging of binaries generated by LLD from MachO objects. llvm-svn: 276921
* [lld][MachO] Add support for S_ATTR_DEBUG to the MachO YAML reader/writer.Lang Hames2016-07-261-0/+2
| | | | | | | This enables proper recognition of debug sections by attribute, which will be used in the near future by test-cases for MachO debugging support. llvm-svn: 276770
* [lld] Update LLD for Archive::child_iterator change in LLVM r275361.Lang Hames2016-07-141-16/+18
| | | | llvm-svn: 275362
* Matching change for lld for the llvm change of Archive::create() from ↵Kevin Enderby2016-06-291-3/+4
| | | | | | ErrorOr<...> to Expected<...> in r274160. llvm-svn: 274161
* [lld][MachO] Remove SimpleFile::definedAtoms().Lang Hames2016-06-282-12/+12
| | | | | | This method just duplicates the functionality of SimpleFile::defined(). llvm-svn: 274048
* [lld][MachO] Remove stray comment.Lang Hames2016-06-271-2/+0
| | | | llvm-svn: 273917
* [lld][MachO] Add support for x86-64 negDelta64 references and fix negDelta32.Lang Hames2016-06-252-37/+61
| | | | | | | | | | These references are used to implement MachO/x64-64 subtractor relocations where the minuend is being fixed up, rather than the subtrahend. The 64-bit version was not previously supported, the 32-bit version was partially implemented but contained bugs not caught by existing test cases. This patch fixes both functionality and test coverage. llvm-svn: 273759
* Apply clang-tidy's misc-move-constructor-init to lld.Benjamin Kramer2016-06-031-1/+2
| | | | | | No functionality change intended. llvm-svn: 271686
* Fix some Include What You Use warnings; other minor fixes.Eugene Zelenko2016-04-292-12/+34
| | | | | | Differential revision: http://reviews.llvm.org/D19735 llvm-svn: 268093
* Fix builds broken in r267008.Eugene Zelenko2016-04-211-0/+1
| | | | llvm-svn: 267010
* Fix Clang-tidy misc-unused-using-decls and Include What You Use warnings.Eugene Zelenko2016-04-211-10/+12
| | | | | | Differential revision: http://reviews.llvm.org/D19348 llvm-svn: 267008
* Add missing header (NFC)Mehdi Amini2016-04-181-1/+2
| | | | | From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266597
* Add missing header (NFC)Mehdi Amini2016-04-181-0/+1
| | | | | From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266596
* [lld][MachO] Clean up some unnecessarily verbose code. NFC.Lang Hames2016-04-061-4/+1
| | | | | | Suggested by Dave Blaikie in review of r265447. Thanks Dave! llvm-svn: 265566
* [lld][MachO] Check Expected<T> for error prior to destruction.Lang Hames2016-04-051-15/+17
| | | | | | This should fix the failures on the LLD bots caused by r265446. llvm-svn: 265477
* Revert "Remove useless unreachable. Switch coverage already gives us this. ↵Pete Cooper2016-03-311-0/+1
| | | | | | | | | | | | NFC" This reverts commit r264945. The commit only removed an unreachable in a method with a covered switch, but GCC is likely to warn on this, and the coding standards recommend just leaving in the unreachable. llvm-svn: 264983
* Use Expected<T> instead of ErrorOr<T>in yaml reader. NFCPete Cooper2016-03-312-4/+5
| | | | llvm-svn: 264981
* Change library search methods to return Optional instead of ErrorOr.Pete Cooper2016-03-311-13/+14
| | | | | | | | | | | | These methods weren't really throwing errors. The only error used was that a file could not be found, which isn't really an error at all as we are searching paths and libraries for a file. All of the callers also ignored errors and just used the returned path if one was available. Changing to return Optional<StringRef> as that actually reflects what we are trying to do here: optionally find a given path. llvm-svn: 264979
* Fix a bunch more of -Wpessimizing-move issues.Pete Cooper2016-03-311-4/+4
| | | | | | Thanks to Rui for pointing out this warning was firing. llvm-svn: 264978
* Fix a bunch of -Wpessimizing-move issues.Pete Cooper2016-03-313-4/+4
| | | | | | Thanks to Rui for pointing out this warning was firing. llvm-svn: 264977
* Convert a few macho reader/writer helpers to new error handling. NFC.Pete Cooper2016-03-312-30/+34
| | | | | | | | These methods were responsible for some of the few remaining calls to llvm::errorCodeToError. Converting them makes us have more Error's in the api and fewer error_code's. llvm-svn: 264974
* Convert readBinary to llvm::Error. NFCPete Cooper2016-03-303-11/+12
| | | | llvm-svn: 264973
OpenPOWER on IntegriCloud