summaryrefslogtreecommitdiffstats
path: root/lld
Commit message (Collapse)AuthorAgeFilesLines
...
* [ELF][MIPS] Use llvm-mc to generate test case input file. NFCSimon Atanasyan2018-07-032-22/+23
| | | | llvm-svn: 336201
* [ELF] - Add a comment. NFC.George Rimar2018-07-031-0/+1
| | | | | | | Minor follow up for r336197 "[ELF] - Add support for '||' and '&&' in linker scripts." llvm-svn: 336199
* [ELF] - Add support for '||' and '&&' in linker scripts.George Rimar2018-07-033-7/+29
| | | | | | | This is https://bugs.llvm.org//show_bug.cgi?id=37976, we had no support, but seems someone faced it. llvm-svn: 336197
* [ELF] Don't create empty output section for unreferenced PROVIDEsJames Henderson2018-07-032-1/+38
| | | | | | | | | | | | | | | | | | | | LLD removes empty output sections otherwise specified in the linker script. Prior to this change however, if section descriptions included ANY kind of symbol assignment, then the consequent output section would not be removed, even if the assignment was marked with PROVIDE and not actually triggered (i.e. the symbol was never referenced). This change modifies the isDiscarable function to ignore such directives when determining whether a section should be discarded, in keeping with bfd's behaviour. Symbol assignments that do result in a symbol definition will continue to result in a kept section (this is not actually the same as bfd's behaviour, but it is simpler, and probably makes more sense). Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D48771 llvm-svn: 336184
* [ELF][AArch64] Add test case for load/store exclusive instructions [NFC]Peter Smith2018-07-031-74/+119
| | | | | | | | | | | | The AArch64 -fix-cortex-a53-843419 is missing a test case for the load and store exclusive instructions. This was leading to a function not being covered in the codebase. This change adds two new instruction sequences to be recognised as an instance of the erratum, one with a load exclusive the other with a store exclusive. Differential Revision: https://reviews.llvm.org/D48840 llvm-svn: 336181
* [ELF] - Revert mips-tls-64-pic-local-variable.s changed in r336129.George Rimar2018-07-031-1/+1
| | | | | | This restores the original comment in the test case. llvm-svn: 336180
* [ELF] - Revert huge-temporary-file.s changed in r336129George Rimar2018-07-031-1/+1
| | | | | | | | | | | | | | | | Comment in the test case says that: ## This inputs previously created a 4gb temporarily file under 32 bit ## configuration. Issue was fixed. There is no clean way to check that from here. ## This testcase added for documentation purposes. The intention of the test was to create such huge file in case if our code will be broken again. And currently it documents we do not create huge outputs. r336129 changed -o to /dev/null and broke the intentions of the test case. llvm-svn: 336179
* [LTO] Errors in LLVM backend should manifest as lld errorsSam Clegg2018-07-024-3/+37
| | | | | | Differential Revision: https://reviews.llvm.org/D48812 llvm-svn: 336143
* [ELF] Fix other tests after r336129Fangrui Song2018-07-028-12/+12
| | | | llvm-svn: 336136
* [ELF] Fix just-symbols*.s after r336129Fangrui Song2018-07-022-3/+3
| | | | llvm-svn: 336135
* [ELF] Replace unused output filenames with /dev/null in testsFangrui Song2018-07-02213-241/+241
| | | | | | Post commit review at rLLD335992 llvm-svn: 336129
* [WebAssembly] Set threadmodel during LTOSam Clegg2018-07-022-1/+18
| | | | | | | | Subscribers: dschuff, mehdi_amini, inglorion, jgravelle-google, aheejin, sunfish, steven_wu, llvm-commits Differential Revision: https://reviews.llvm.org/D48689 llvm-svn: 336118
* [ELF] - Cleanup error reporting code and cover with the test. NFC.George Rimar2018-07-022-2/+21
| | | | | | | | | | | | | | | | We have the following code that is uncovered with the test: https://github.com/llvm-mirror/lld/blob/master/ELF/Target.cpp#L95 This patch: 1) Removes "!IS" check. Because at that point of execution (we are reolving the relocations during writing output) we should only have InputSection type of the sections in the vector. (because we already converted MergeInputSection in mergeSections() and combined EhInputSections in combineEhFrameSections()). 2) Covers the "!IS->getParent()" with the test. llvm-svn: 336106
* [ELF] - Remove dead code. NFC.George Rimar2018-07-021-1/+0
| | | | | | It duplicated the default implementation. llvm-svn: 336093
* [ELF] - Change dyn_cast to cast. NFC.George Rimar2018-07-021-1/+1
| | | | | | | | This is followup for r335958. Thanks to Rui for noticing. llvm-svn: 336082
* Fix test after S_PROCREF change.Zachary Turner2018-06-292-6/+6
| | | | | | | | Since the names are being hashed correctly now, enumerating them returns them in a different order. Update the test to reflect that. llvm-svn: 336027
* [ELF] Set -o because current directory may not be writable during a testFangrui Song2018-06-291-1/+1
| | | | llvm-svn: 335992
* [lld] Address post-commit review of r335848Filipe Cabecinhas2018-06-291-1/+1
| | | | llvm-svn: 335985
* [ELF] - Linker script: add tests for checking malformed numbers parsing.George Rimar2018-06-291-2/+17
| | | | | | | | | | | | | | Previoulsy we had no test that covered malfolmed numbers with 'H', 'K' and 'M' suffixes, so the following lines were uncovered: https://github.com/llvm-mirror/lld/blob/master/ELF/ScriptParser.cpp#L996 https://github.com/llvm-mirror/lld/blob/master/ELF/ScriptParser.cpp#L1003 https://github.com/llvm-mirror/lld/blob/master/ELF/ScriptParser.cpp#L1008 Patch fixes that. llvm-svn: 335979
* [ELF] - Eliminate dead code from shouldKeepInSymtab. NFC.George Rimar2018-06-291-3/+0
| | | | | | | | | | | | | | | | shouldKeepInSymtab is called from copyLocalSymbols: https://github.com/llvm-mirror/lld/blob/master/ELF/Writer.cpp#L574 The pre-condition is that symbol should be Defined: https://github.com/llvm-mirror/lld/blob/master/ELF/Writer.cpp#L572 And its section is Live: https://github.com/llvm-mirror/lld/blob/master/ELF/Writer.cpp#L548 InputSection::Discarded section can never be Live. And hence I believe check I removed in this patch is excessive. llvm-svn: 335973
* [ELF] - EhFrame.cpp: cover personality encoding handling code with the test ↵George Rimar2018-06-296-0/+196
| | | | | | | | | | | | | | | | cases. CIEs augmentation string can have 'P' character, what means the next byte is the personality encoding, a DW_EH_PE_xxx value. This is followed by a pointer to the personality function. We had the support of the different encodings earlier, but had no test cases. This change adds coverage of DW_EH_PE_absptr/DW_EH_PE_signed/DW_EH_PE_udata2/DW_EH_PE_sdata2 and DW_EH_PE_udata8/DW_EH_PE_sdata8 cases for place below: https://github.com/llvm-mirror/lld/blob/master/ELF/EhFrame.cpp#L123 llvm-svn: 335969
* [ELF] - Remove dead code.George Rimar2018-06-291-3/+0
| | | | | | | | | | | | I do not think this code was ever alive, because the following code says we can have OutputSection and SymbolAssignment cases only. We already handle both of them. https://github.com/llvm-mirror/lld/blob/master/ELF/ScriptParser.cpp#L502 FWIW, it is dead in the LLD code coverage reports I am running either. llvm-svn: 335958
* [ELF] - Add test case to test 32 bits output.George Rimar2018-06-291-0/+21
| | | | | | | | | | | | | We had no tests that checked how we print -Map output for 32 bit targets. Though there are at least 2 places where we have the difference. (between 64 and 32 bits): https://github.com/llvm-mirror/lld/blob/master/ELF/MapFile.cpp#L52 https://github.com/llvm-mirror/lld/blob/master/ELF/MapFile.cpp#L162 Patch adds just a trivial test to check we do right things in general. llvm-svn: 335954
* [MinGW] Implement the GNU ld options -S/--strip-debugMartin Storsjo2018-06-293-0/+10
| | | | | | | | | In this mode, we retain the symbol table, but skip the actual debug information. Differential Revision: https://reviews.llvm.org/D48745 llvm-svn: 335947
* [COFF] Add an LLD specific option -debug:symbtabMartin Storsjo2018-06-296-1/+19
| | | | | | | | | | | With this set, we retain the symbol table, but skip the actual debug information. This is meant to be used by the MinGW frontend. Differential Revision: https://reviews.llvm.org/D48745 llvm-svn: 335946
* [WebAssembly] Fix --export of LTO symbolsSam Clegg2018-06-284-13/+53
| | | | | | Differential Revision: https://reviews.llvm.org/D48697 llvm-svn: 335881
* [WebAssembly] Add support for bitcode archive membersSam Clegg2018-06-289-17/+65
| | | | | | | | | | This change effects the behavior of --export-all. Previously --export-all would only effect symbols that survived GC. Now --export-all will prevent any non-local symbols from being GCed. Differential Revision: https://reviews.llvm.org/D48673 llvm-svn: 335878
* [WebAssembly] LTO: Fix signatures of undefined functions in bitcodeSam Clegg2018-06-285-14/+40
| | | | | | | | | | | Function symbols that come from bitcode have not signatures. After LTO when the real symbols are read in we need to make sure that we set the signature on the existing symbol. the signature-less undefined functions. Differential Revision: https://reviews.llvm.org/D48693 llvm-svn: 335875
* lld-link: align sections to 16 bytes if referenced from the gfids tableBob Haarman2018-06-283-0/+101
| | | | | | | | | | | | | | | | | | | Summary: Control flow guard works best when targets it checks are 16-byte aligned. Microsoft's link.exe helps ensure this by aligning code from sections that are referenced from the gfids table to 16 bytes when linking with -guard:cf, even if the original section specifies a smaller alignment. This change implements that behavior in lld-link. See https://crbug.com/857012 for more details. Reviewers: ruiu, hans, thakis, zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D48690 llvm-svn: 335864
* [ELF] - EhFrame.cpp: add test case to check "CIE is too small" error message.George Rimar2018-06-281-0/+15
| | | | | | | | | The following line of code was untested: https://github.com/llvm-mirror/lld/blob/master/ELF/EhFrame.cpp#L94 Patch adds a test case. llvm-svn: 335855
* [ELF] - EhFrame.cpp: add test case to cover "corrupted CIE" error message.George Rimar2018-06-281-0/+30
| | | | | | | This is to test the following line that was uncovered by LLD test cases yet: https://github.com/llvm-mirror/lld/blob/master/ELF/EhFrame.cpp#L149 llvm-svn: 335852
* [ELF] - EhFrame.cpp: add test case to cover "DW_EH_PE_aligned encoding is ↵George Rimar2018-06-281-0/+30
| | | | | | | | | not supported" error. It is https://github.com/llvm-mirror/lld/blob/master/ELF/EhFrame.cpp#L144, and we had no test case to cover it. llvm-svn: 335849
* Fix warning on MSVC by using size_t arithmetic instead of casting after the ↵Filipe Cabecinhas2018-06-281-1/+1
| | | | | | fact. NFC llvm-svn: 335848
* [ELF] - EhFrame.cpp: add test case to check "unknown FDE encoding".George Rimar2018-06-281-0/+31
| | | | | | | It's https://github.com/llvm-mirror/lld/blob/master/ELF/EhFrame.cpp#L147 line, which was untested before this patch. llvm-svn: 335847
* [ELF] - EhFrame: add test case to cover uncovered branch of the code.George Rimar2018-06-281-0/+28
| | | | | | | | | | This test case adds test for the line that was uncovered previously: https://github.com/llvm-mirror/lld/blob/master/ELF/EhFrame.cpp#L175 it errors out, but we now can test that we have expected flow, which is different for CIE of version 1 and CIE of version 3. llvm-svn: 335840
* [ELF] - Cover "unknown .eh_frame augmentation string" error.George Rimar2018-06-281-0/+28
| | | | | | | | | It was https://github.com/llvm-mirror/lld/blob/master/ELF/EhFrame.cpp#L195 and we did not cover it with test. Patch fixes it. llvm-svn: 335838
* [ELF] - Add test case to cover "corrupted CIE (failed to read LEB128)" error.George Rimar2018-06-281-0/+21
| | | | | | | | | It is the following line: https://github.com/llvm-mirror/lld/blob/master/ELF/EhFrame.cpp#L120 We did not cover it yet. llvm-svn: 335833
* [ELF] - Removed trailing whitespace. NFC.George Rimar2018-06-281-1/+0
| | | | llvm-svn: 335826
* [ELF] - Add test case to cover "corrupted CIE (failed to read string)"George Rimar2018-06-281-0/+23
| | | | | | It was uncovered by our test cases. llvm-svn: 335824
* [ELF] - Add test case to cover "unexpected end of CIE" error.George Rimar2018-06-281-0/+17
| | | | | | It was uncovered by our test cases. llvm-svn: 335819
* [ELF] - Get rid of precompiled elf object in test case.George Rimar2018-06-282-4/+17
| | | | | | | | | We has precompiled object with unsupported FDE version (=2). It is possible to use llvm-mc instead for this test. Patch do this change. llvm-svn: 335818
* [ELF] Use %eiz after disassembler change in r335768Fangrui Song2018-06-271-2/+2
| | | | llvm-svn: 335784
* [ELF] Rename RF_PROGBITS_NOT_EXEC_OR_WRITE to RF_RODATAFangrui Song2018-06-271-7/+6
| | | | | | Post commit review at D48406 llvm-svn: 335743
* [ELF] - ICF: Add test case to check many sections case.George Rimar2018-06-271-0/+62
| | | | | | | | | | | | Currently, ICF does not enable threading if we have less than 1024 sections in each equivalence class. And the following code is uncovered by our test cases: https://github.com/llvm-mirror/lld/blob/master/ELF/ICF.cpp#L404 This patch adds a test case that triggers the mentioned code to execute. llvm-svn: 335738
* [PPC64] Add support for R_PPC64_GOT_DTPREL16* relocationsZaara Syeda2018-06-276-8/+80
| | | | | | | | | | | | | | The local dynamic TLS access on PPC64 ELF v2 ABI uses R_PPC64_GOT_DTPREL16* relocations when a TLS variables falls outside 2 GB of the thread storage block. This patch adds support for these relocations by adding a new RelExpr called R_TLSLD_GOT_OFF which emits a got entry for the TLS variable relative to the dynamic thread pointer using the relocation R_PPC64_DTPREL64. It then evaluates the R_PPC64_GOT_DTPREL16* relocations as the got offset for the R_PPC64_DTPREL64 got entries. Differential Revision: https://reviews.llvm.org/D48484 llvm-svn: 335732
* [PPC64] Add TLS global dynamic to local exec relaxationZaara Syeda2018-06-272-0/+120
| | | | | | | | | | | | | | | This patch adds the target call back relaxTlsGdToLe to support TLS relaxation from global dynamic to local exec model. The relaxation performs the following transformation: addis r3, r2, x@got@tlsgd@ha --> nop addi r3, r3, x@got@tlsgd@l --> addis r3, r13, x@tprel@ha bl __tls_get_addr(x@tlsgd) --> nop nop --> addi r3, r3, x@tprel@l Differential Revision: https://reviews.llvm.org/D48082 llvm-svn: 335730
* [ELF] - Implement linker script OVERLAYs.George Rimar2018-06-276-10/+141
| | | | | | | | | | | | | | | | | | This is PR36768. Linker script OVERLAYs are described in 4.6.9. Overlay Description of the spec: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Using_ld_the_GNU_Linker/sections.html They are used to allow output sections which have different LMAs but the same VAs and used for embedded programming. Currently, LLD restricts overlapping of sections and that seems to be the most desired behaviour for defaults. My thoughts about possible approaches for PR36768 are on the bug page, this patch implements OVERLAY keyword and allows VAs overlapping for sections that within the overlay. Differential revision: https://reviews.llvm.org/D44780 llvm-svn: 335714
* Make -z option check more strict.Rui Ueyama2018-06-273-17/+11
| | | | llvm-svn: 335713
* Report an error for an unknown -z option.Rui Ueyama2018-06-272-0/+23
| | | | | | | | | This is a less clever version of https://reviews.llvm.org/D48433. This is a dumb version but I think I prefer this for its simplicity. Differential Revision: https://reviews.llvm.org/D48621 llvm-svn: 335712
* [ELF] Move `// REQUIRES:` line to the topFangrui Song2018-06-26127-132/+127
| | | | llvm-svn: 335676
OpenPOWER on IntegriCloud