summaryrefslogtreecommitdiffstats
path: root/lld/test
Commit message (Collapse)AuthorAgeFilesLines
...
* lld: add experimental support for SHT_RELR sections.Rui Ueyama2018-07-091-103/+258
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch by Rahul Chaudhry! This change adds experimental support for SHT_RELR sections, proposed here: https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg Pass '--pack-dyn-relocs=relr' to enable generation of SHT_RELR section and DT_RELR, DT_RELRSZ, and DT_RELRENT dynamic tags. Definitions for the new ELF section type and dynamic array tags, as well as the encoding used in the new section are all under discussion and are subject to change. Use with caution! Pass '--use-android-relr-tags' with '--pack-dyn-relocs=relr' to use SHT_ANDROID_RELR section type instead of SHT_RELR, as well as DT_ANDROID_RELR* dynamic tags instead of DT_RELR*. The generated section contents are identical. '--pack-dyn-relocs=android+relr --use-android-relr-tags' enables both '--pack-dyn-relocs=android' and '--pack-dyn-relocs=relr': lld will encode the relative relocations in a SHT_ANDROID_RELR section, and pack the rest of the dynamic relocations in a SHT_ANDROID_REL(A) section. Differential Revision: https://reviews.llvm.org/D48247 llvm-svn: 336594
* [PPC64] Add TLS local dynamic to local exec relaxationZaara Syeda2018-07-091-0/+84
| | | | | | | | | This patch adds the target call back relaxTlsLdToLe to support TLS relaxation from local dynamic to local exec model. Differential Revision: https://reviews.llvm.org/D48293 llvm-svn: 336559
* [PDB] One more fix for hasing GSI records.Zachary Turner2018-07-062-0/+81
| | | | | | | | | | | | | | | | The reference implementation uses a case-insensitive string comparison for strings of equal length. This will cause the string "tEo" to compare less than "VUo". However we were using a case sensitive comparison, which would generate the opposite outcome. Switch to a case insensitive comparison. Also, when one of the strings contains non-ascii characters, fallback to a straight memcmp. The only way to really test this is with a DIA test. Before this patch, the test will fail (but succeed if link.exe is used instead of lld-link). After the patch, it succeeds even with lld-link. llvm-svn: 336464
* [ELF] - Add test for empty version in a symbol name. George Rimar2018-07-061-0/+20
| | | | | | | This covers the following line which was untested: https://github.com/llvm-mirror/lld/blob/master/ELF/Symbols.cpp#L170 llvm-svn: 336443
* Relax filechecks in r336405 testsHans Wennborg2018-07-063-12/+12
| | | | | | | | | | | | | | | | | | | They were failing in Chromium's packaging builds with: C:\b\rr\tmphqfaff\w\src\third_party\llvm\tools\lld\test\COFF\pdb-globals-dia-vfunc-collision2.test:24:8: error: expected string not found in input CHECK: func [0x00001060+ 0 - 0x0000106c-12 | sizeof= 12] (FPO) virtual int __cdecl A132() ^ <stdin>:8:11: note: scanning from here struct S [sizeof = 8] { ^ <stdin>:9:2: note: possible intended match here func [0x00001060+ 0 - 0x0000106c-12 | sizeof= 12] (FPO) virtual int __cdecl S::A132() ^ Maybe due to different DIA versions. llvm-svn: 336424
* dos2unixHans Wennborg2018-07-063-93/+93
| | | | llvm-svn: 336423
* [ELF][MIPS] Remove support for linking microMIPS 64-bit codeSimon Atanasyan2018-07-064-93/+23
| | | | | | | | | Remove support for linking microMIPS 64-bit code because this kind of ISA is rarely used and unsupported by LLVM. Differential revision: https://reviews.llvm.org/D48949 llvm-svn: 336413
* [llvm-pdbutil] Dump more info about globals.Zachary Turner2018-07-061-0/+19
| | | | | | | | | | | | | | | We add an option to dump the entire global / public symbol record stream. Previously we would dump globals or publics, but not both. And when we did dump them, we would always dump them in the order they were referenced by the corresponding hash streams, not in the order they were serialized in. This patch adds a lower level mode that just dumps the whole stream in serialization order. Additionally, when dumping global-extras, we now dump the hash bitmap as well as the record offset instead of dumping all zeros for the offsets. llvm-svn: 336407
* [PDB] Sort globals symbols by name in GSI hash buckets.Zachary Turner2018-07-066-0/+93
| | | | | | | | | | | It seems like the debugger first computes a symbol's bucket, and then does a binary search of entries in the bucket using the symbol's name in order to find it. If the bucket entries are not in sorted order, this obviously won't work. After this patch a couple of simple test cases show that we generate an exactly identical GSI hash stream, which is very nice. llvm-svn: 336405
* Simplify PPC64::calcEFlags().Rui Ueyama2018-07-051-0/+11
| | | | | | | | | | In this file we only have to handle the v2 ABI, so what we need to do is to just make sure that all object files have v2 or unspecified version number. Differential Revision: https://reviews.llvm.org/D48112 llvm-svn: 336372
* Make a test more robust.Rui Ueyama2018-07-051-0/+5
| | | | | | Reported by Chris Jackson. llvm-svn: 336366
* [ELF] - Add test case for checking PT_INTERP behavior.George Rimar2018-07-051-0/+21
| | | | | | | | | | | | | When PT_INTERP is specified in PHDRS command, it should be created. (if other conditions met) We had no test for the folowing line: https://github.com/llvm-mirror/lld/blob/master/ELF/LinkerScript.cpp#L1108 And for this header itself. Patch fixes that. llvm-svn: 336359
* [ELF] - Test we are able to assign version to symbols that are not "_Z*"George Rimar2018-07-051-0/+22
| | | | | | | | | | This is to test the following line of the code: https://github.com/llvm-mirror/lld/blob/master/ELF/SymbolTable.cpp#L681 If symbol does not start from _Z prefix and we have extern "C++", we do not call demangler and use its name as is. llvm-svn: 336353
* [ELF] - Check we do not assign version to undefined symbol when using extern ↵George Rimar2018-07-051-0/+19
| | | | | | | | | C++. This tests the following 'continue' line in getDemangledSyms(): https://github.com/llvm-mirror/lld/blob/master/ELF/SymbolTable.cpp#L677 llvm-svn: 336349
* [ELF] - Add test to check we don't crash when tracing reserved symbol.George Rimar2018-07-051-0/+3
| | | | | | | | | This is to test the following line of code: https://github.com/llvm-mirror/lld/blob/master/ELF/SymbolTable.cpp#L601 Without that line linker would crash. llvm-svn: 336345
* [ELF] - Test LLD creates empty .imports file.George Rimar2018-07-051-2/+6
| | | | | | | | | This covers the following code line with a test: https://github.com/llvm-mirror/lld/blob/master/ELF/LTO.cpp#L213 After that, coverage of LTO.cpp is 100%. llvm-svn: 336342
* [ELF] - Add test to check we produce an error if unable to write an empty ↵George Rimar2018-07-051-0/+10
| | | | | | | | | | | | index file. Test case ensures lld generates an error if unable to write an empty index file for lazy object file that is not added to link. This covers the following line with a test: https://github.com/llvm-mirror/lld/blob/master/ELF/LTO.cpp#L206 llvm-svn: 336340
* [ELF] - Advance position in a memory region when change the Dot.George Rimar2018-07-052-0/+38
| | | | | | | | | | | | This is https://bugs.llvm.org//show_bug.cgi?id=37836 Previously LLD could assign to Dot or set the address for the section with address expression but did not advance the position in a memory region. Patch fixes the issue. llvm-svn: 336335
* [ELF] - Extend edata-etext.s test case.George Rimar2018-07-041-1/+5
| | | | | | | | | | | | | We did not have a test that would test that _etext address is equal to etext, _end == end and _edata == edata. Because of that, the following line was never executed when running our tests: https://github.com/llvm-mirror/lld/blob/master/ELF/Writer.cpp#L928 Patch fixes that. llvm-svn: 336280
* [ELF] - Cover handling of DW_AT_external with test.George Rimar2018-07-041-1/+30
| | | | | | | | | The following check was uncovered with tests: https://github.com/llvm-mirror/lld/blob/master/ELF/InputFiles.cpp#L159 Patch adds test to cover it. llvm-svn: 336273
* [ELF] - LTO: add test for createEmptyIndex.George Rimar2018-07-041-0/+5
| | | | | | | | | | | | | | | | We have a following comment for createEmptyIndex caller code: // If LazyObjFile has not been added to link, emit empty index files. // This is needed because this is what GNU gold plugin does and we have a // distributed build system that depends on that behavior. Though createEmptyIndex() itself (https://github.com/llvm-mirror/lld/blob/master/ELF/LTO.cpp#L202) is never called in our test cases. Patch adds a test. llvm-svn: 336270
* [ELF] - Add a test case for relocation pointing to deduplicated COMDAT.George Rimar2018-07-042-0/+23
| | | | | | | | | | | | ELF spec doesn't allow a relocation to point to a deduplicated COMDAT section. Unfortunately this happens in practice (e.g. .eh_frame) We have a code in MarkLive.cpp for that and it was uncovered by any test case: https://github.com/llvm-mirror/lld/blob/master/ELF/MarkLive.cpp#L199 Patch adds a test. llvm-svn: 336259
* [ELF][MIPS] Use llvm-mc to generate test case input file. NFCSimon Atanasyan2018-07-032-22/+23
| | | | llvm-svn: 336201
* [ELF] - Add support for '||' and '&&' in linker scripts.George Rimar2018-07-031-0/+16
| | | | | | | 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-031-0/+30
| | | | | | | | | | | | | | | | | | | | 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-023-2/+25
| | | | | | 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-021-0/+14
| | | | | | | | 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-021-0/+19
| | | | | | | | | | | | | | | | 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
* 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
* [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] - 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] - 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-291-0/+5
| | | | | | | | | 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-292-0/+15
| | | | | | | | | | | 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-281-0/+38
| | | | | | Differential Revision: https://reviews.llvm.org/D48697 llvm-svn: 335881
* [WebAssembly] Add support for bitcode archive membersSam Clegg2018-06-283-7/+41
| | | | | | | | | | 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-281-0/+20
| | | | | | | | | | | 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-282-0/+96
| | | | | | | | | | | | | | | | | | | 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
* [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
OpenPOWER on IntegriCloud