summaryrefslogtreecommitdiffstats
path: root/lld
Commit message (Collapse)AuthorAgeFilesLines
...
* Split BitcodeCompiler::init() into two functions. NFC.Rui Ueyama2018-05-072-34/+33
| | | | | | | | | Previously, code to initialize Backend and code to initialize Conf are intermingled in init(), though they don't depend on each other. Differential Revision: https://reviews.llvm.org/D46554 llvm-svn: 331698
* Add support for thinlto option ( thinlto-emit-imports-files) to emit import ↵Rumeet Dhindsa2018-05-074-7/+72
| | | | | | | | files for thinlink. Differential Revision: https://reviews.llvm.org/D46400 llvm-svn: 331696
* Do not call exit() directly from lld.Rui Ueyama2018-05-073-2/+12
| | | | | | | | | | Our promise is that as long as there's no fatal error (i.e. broken file is given to the linker), our main function returns to the caller. So we can't use exit() in the regular code path. Differential Revision: https://reviews.llvm.org/D46442 llvm-svn: 331690
* Refactor ThinLTO-related code in BitcodeCompiler.cpp. NFC.Rui Ueyama2018-05-073-54/+35
| | | | | | | | | | | | Summary: Refactor ThinLTO-related code in BitcodeCompiler.cpp. NFC. Reviewers: rdhindsa, espindola Subscribers: emaste, inglorion, arichardson, llvm-commits, eraman Differential Revision: https://reviews.llvm.org/D46549 llvm-svn: 331689
* Add test to ensure lld writes linked files to linked objects file for ↵Rumeet Dhindsa2018-05-071-0/+7
| | | | | | | | ThinLTO Indexing Only option. Differential Revision: https://reviews.llvm.org/D46542 llvm-svn: 331671
* Do not pass Config members to simplify function signature. NFC.Rui Ueyama2018-05-071-9/+4
| | | | llvm-svn: 331658
* Parse --thinlto-prefix-replace early so that we don't need to parse it ↵Rui Ueyama2018-05-073-19/+14
| | | | | | later. NFC. llvm-svn: 331657
* Use StringRef instead of `const std::string &`. NFC.Rui Ueyama2018-05-071-3/+3
| | | | llvm-svn: 331656
* Refactor BitcodeCompiler::createLTO. NFC.Rui Ueyama2018-05-072-19/+22
| | | | llvm-svn: 331655
* ELF Thunks: fix build error: missing 'overrides'Roman Lebedev2018-05-061-1/+1
| | | | llvm-svn: 331608
* [PPC64] Emit plt call stubs to the text section rather then the plt section.Sean Fertile2018-05-067-98/+156
| | | | | | | | | | | | | | | | | | On PowerPC calls to functions through the plt must be done through a call stub that is responsible for: 1) Saving the toc pointer to the stack. 2) Loading the target functions address from the plt into both r12 and the count register. 3) Indirectly branching to the target function. Previously we have been emitting these call stubs to the .plt section, however the .plt section should be reserved for the lazy symbol resolution stubs. This patch moves the call stubs to the text section by moving the implementation from writePlt to the thunk framework. Differential Revision: https://reviews.llvm.org/D46204 llvm-svn: 331607
* Fix -Wunused-variable warning introduced at r331566.Andrea Di Biagio2018-05-051-1/+1
| | | | llvm-svn: 331589
* [WebAssembly] Check function signatures by defaultSam Clegg2018-05-0545-77/+82
| | | | | | | | | But only produce a warning (for now) unless --fatal-warnings is passed. Differential Revision: https://reviews.llvm.org/D46484 llvm-svn: 331574
* Add llvm-dwarfdump tool_patternsSam Clegg2018-05-051-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D46481 llvm-svn: 331572
* [WebAssembly] Only perform sanity checking of relocation targets in debug buildsSam Clegg2018-05-052-10/+45
| | | | | | | | | | | Also: - Reduce the error to a warning so that debug and release versions can still link the same inputs. - Add another check to verify the input LEB is padded to 5 bytes Differential Revision: https://reviews.llvm.org/D46479 llvm-svn: 331571
* [WebAssembly] Add support for debug (DWARF) sectionsSam Clegg2018-05-0412-19/+391
| | | | | | | | | | | | | | Specifically add support for custom sections that contain relocations, and for the two new relocation types needed by DWARF sections. See: https://reviews.llvm.org/D44184 Patch by Yury Delendik! Differential Revision: https://reviews.llvm.org/D44184 llvm-svn: 331566
* [ELF][MIPS] Reorganize isMipsPIC routine. NFCSimon Atanasyan2018-05-041-7/+10
| | | | llvm-svn: 331555
* [ELF][MIPS] Add STO_MIPS_MICROMIPS flag to symbols point to microMIPS PLT ↵Simon Atanasyan2018-05-042-4/+9
| | | | | | records llvm-svn: 331554
* Object: The default alignment of a section without alignment flags is 16.Peter Collingbourne2018-05-044-114/+135
| | | | | | Differential Revision: https://reviews.llvm.org/D46420 llvm-svn: 331538
* [PPC64] Remove support for ELF V1 ABI in LLD - buildbot fixZaara Syeda2018-05-041-4/+11
| | | | | | | | | Fix buildbot error, failure to build with msvc due to error C2446 Use switch instead of ternary operator. Differential Revision: https://reviews.llvm.org/D46316 llvm-svn: 331534
* [PPC64] Remove support for ELF V1 ABI in LLDZaara Syeda2018-05-0429-457/+391
| | | | | | | | | | | The current support for V1 ABI in LLD is incomplete. This patch removes V1 ABI support and changes the default behavior to V2 ABI, issuing an error when using the V1 ABI. It also updates the testcases to V2 and removes any V1 specific tests. Differential Revision: https://reviews.llvm.org/D46316 llvm-svn: 331529
* [ELF][AArch64] Add aarch64_elf64_le_vec emulationPeter Smith2018-05-042-2/+7
| | | | | | | | | | Android AOSP has started specifying -m aarch64_elf64_le_vec as supported by gold and BFD. This is a simple change to add the emulation so that LLD doesn't immediately error when used as a linker in an AOSP build. Differential Revision: https://reviews.llvm.org/D46429 llvm-svn: 331521
* [ELF][AArch64] Add REQUIRES aarch64 to test [NFC]Peter Smith2018-05-041-0/+2
| | | | | | Forgot to add REQUIRES aarch64 to the test I recently added for D46255. llvm-svn: 331513
* [ELF][AArch64] Implement the AArch64 TLSLD_LDST_LO12 family of relocsPeter Smith2018-05-042-0/+93
| | | | | | | | | | | | | | | | | Implement the following relocations for AArch64: R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC These are specified in ELF for the 64-bit Arm Architecture. Fixes pr36727 Differential Revision: https://reviews.llvm.org/D46255 llvm-svn: 331511
* [COFF] Implement the remaining ARM64 relocationsMartin Storsjo2018-05-044-10/+74
| | | | | | | | | | | Now only IMAGE_REL_ARM64_ABSOLUTE and IMAGE_REL_ARM64_TOKEN are unhandled. Also add range checks for the existing BRANCH26 relocation. Differential Revision: https://reviews.llvm.org/D46354 llvm-svn: 331505
* Added ThinLTO test to verify that index files are not generated if ↵Rumeet Dhindsa2018-05-031-0/+9
| | | | | | | | thinlto-index-only is not enabled. Differential Revision: https://reviews.llvm.org/D46405 llvm-svn: 331478
* [ELF][MIPS] Check that a section has a valid reference to a file in the ↵Simon Atanasyan2018-05-032-9/+29
| | | | | | isMipsPIC routine llvm-svn: 331470
* [WebAssembly] Add --stack-first option which places the shadow stack at ↵Sam Clegg2018-05-035-19/+85
| | | | | | | | | | start of linear memory Fixes https://bugs.llvm.org/show_bug.cgi?id=37181 Differential Revision: https://reviews.llvm.org/D46141 llvm-svn: 331467
* [LLD][AArch64] Simplify relocations sharing same encoding [NFC]Peter Smith2018-05-031-6/+3
| | | | | | | | | | | | | | | The code to encode the result in relocateOne for the relocations: R_AARCH64_LD64_GOT_LO12_NC R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC R_AARCH64_TLSDESC_LD64_LO12 is equivalent to that for R_AARCH64_LDST64_ABS_LO12_NC. This is described in the ABI as "Set the LD/ST immediate field bits [11:3] of X. No overflow check; check that X&7 =0. Differential Revision: https://reviews.llvm.org/D46247 llvm-svn: 331452
* [CMake] Fix BUILD_SHARED_LIBS regression due to r331405David Zarzycki2018-05-031-0/+1
| | | | llvm-svn: 331444
* Update Error MessageRumeet Dhindsa2018-05-031-1/+1
| | | | | | https://reviews.llvm.org/D46375 llvm-svn: 331426
* Updated ThinLTO test to not include forward or backward slash for testingRumeet Dhindsa2018-05-032-4/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D46372 llvm-svn: 331419
* Added support for ThinLTO plugin options : thinlto-index-only and ↵Rumeet Dhindsa2018-05-0210-31/+221
| | | | | | | | thinlto-prefix-replace Differential Revision: https://reviews.llvm.org/D46034 llvm-svn: 331405
* Fix warning: result of 32-bit shift implicitly converted to 64 bits - NFCZaara Syeda2018-04-301-1/+1
| | | | | | | | Fix warning caused by rL331046. Differential Revision: https://reviews.llvm.org/D45729 llvm-svn: 331181
* Add -warn-backrefs (r329636) to lld's man pageEd Maste2018-04-291-1/+10
| | | | llvm-svn: 331133
* Migrate from std::pointer_to_unary_function as it is removed in C++17Fangrui Song2018-04-281-4/+2
| | | | llvm-svn: 331097
* Don't create a temporary DenseMap for each input .eh_frame.Rafael Espindola2018-04-272-1/+5
| | | | | | | | | | These maps are small, but we are creating an destroying one for each input .eh_frame. This patch reduces the total memory allocation from 765.54MB to 749.19MB. The peak is still the same: 563.7MB. llvm-svn: 331075
* Split .eh_frame sections in parellel.Rafael Espindola2018-04-275-15/+10
| | | | | | We can now split them in the same spot we split merge sections. llvm-svn: 331064
* Split merge sections early.Rafael Espindola2018-04-276-23/+13
| | | | | | | | | | | | | | | Now that getSectionPiece is fast (uses a hash) it is probably OK to split merge sections early. The reason I want to do this is to split eh_frame sections in the same place. This does mean that we have to decompress early. Given that the only compressed sections are debug info, I don't think we are missing much. It is a small improvement: 0.5% on the geometric mean. llvm-svn: 331058
* [PPC64] Add offset to local entry point when calling functions without pltZaara Syeda2018-04-274-1/+135
| | | | | | | | | | | | | | PPC64 V2 ABI describes two entry points to a function. The global entry point sets up the TOC base pointer. When calling a local function, the call should branch to the local entry point rather than the global entry point. Section 3.4.1 describes using the 3 most significant bits of the st_other field to find out how many instructions there are between the local and global entry point. This patch adds the correct offset required to branch to the local entry point of a function. Differential Revision: https://reviews.llvm.org/D45729 llvm-svn: 331046
* Do not set RequiresNullTerminator. NFC.Rui Ueyama2018-04-271-1/+1
| | | | | | When reading object files, we don't need '\0' at end of each file. llvm-svn: 331045
* [ELF] Fix typo. NFCFangrui Song2018-04-273-3/+3
| | | | llvm-svn: 331018
* [ELF] Clarify help wording for --symbol-ordering-fileShoaib Meenai2018-04-261-1/+1
| | | | | | | | | | | | | The input file for this option should contain a list of symbols, not a list of sections, so explicitly refer to ordering symbols (but keep the reference to laying out sections, since that's how the option must operate). Referring to the file itself as the "symbol ordering file" is consistent with --warn-symbol-ordering and less ambiguous than "symbol file" (albeit slightly redundant). Differential Revision: https://reviews.llvm.org/D46099 llvm-svn: 331000
* [LLD][WASM] Handle WASM_SYMBOL_TYPE_SECTION in toString().Roman Lebedev2018-04-261-0/+2
| | | | | | | Fixes build. If this is not the desired solution, please revert. WasmSymbolType was changed in rL330982 / D44184 llvm-svn: 330984
* Delete unused variable.Rafael Espindola2018-04-261-1/+1
| | | | llvm-svn: 330978
* [WebAssembly] Add version to linking section (to match llvm-side change)Sam Clegg2018-04-2610-7/+10
| | | | | | Differential Revision: https://reviews.llvm.org/D46070 llvm-svn: 330971
* Add a comment. NFC.Rafael Espindola2018-04-261-0/+5
| | | | llvm-svn: 330967
* Replace SharedSymbols with Defined when creating copy relocations.Rafael Espindola2018-04-269-83/+65
| | | | | | | | | | | | | This is slightly simpler to read IMHO. Now if a symbol has a position in the file, it is Defined. The main motivation is that with this a SharedSymbol doesn't need a section, which reduces the size of SymbolUnion. With this the peak allocation when linking chromium goes from 568.1 to 564.2 MB. llvm-svn: 330966
* Simplify processRelocAux.Rafael Espindola2018-04-262-19/+21
| | | | | | | | | | | It returns a different Expr only in the case of creating a function symbol pointing to its plt entry. We can just add a call to addPltEntry to avoid that and return void. With this patch further simplifications of how we handle copy relocations are possible. llvm-svn: 330960
* Delete GotPltIndex.Rafael Espindola2018-04-263-4/+5
| | | | | | | | | It was always an offset of PltIndex. This doesn't reduce the size of the structures, but makes it easier to do so in a followup patch. llvm-svn: 330953
OpenPOWER on IntegriCloud