summaryrefslogtreecommitdiffstats
path: root/lld/test/ELF/invalid
Commit message (Collapse)AuthorAgeFilesLines
* [LLD][ELF] - Update tests after yaml2obj tool update.George Rimar2019-10-202-2/+0
| | | | | | yaml2obj doesn't create .symtab by default anymore. llvm-svn: 375360
* Improve error message for bad SHF_MERGE sectionsRui Ueyama2019-10-102-1/+8
| | | | | | | | This patch adds a section name to error messages. Differential Revision: https://reviews.llvm.org/D68758 llvm-svn: 374290
* [ELF][test] Update test after r371185Fangrui Song2019-09-061-1/+1
| | | | llvm-svn: 371189
* [ELF][AArch64] Improve error message for unknown relocationsFangrui Song2019-08-151-0/+31
| | | | | | | | | | | | | | | | | | | | Like rLLD354040. Previously, for unrecognized relocation types, in -no-pie/-pie mode, we got something like: foo.o: unrecognized relocation ... In -shared mode: error: can't create dynamic relocation ... against symbol: yyy in readonly segment Delete the default case from AArch64::getRelExpr and add the error there. Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D66277 llvm-svn: 368983
* [LLD][ELF] - Update a test after LLVM change.George Rimar2019-07-051-2/+2
| | | | | | Error reporting changed in r365183 llvm-svn: 365184
* [LLD][ELF] - Replace invalid-e_shnum.s with YAML based version.George Rimar2019-06-273-3/+15
| | | | | | | | | The previous version used a precompiled binary. After this patch, we have no more precompiled binaries in LLD ELF test suite :) llvm-svn: 364529
* [LLD][ELF] - Fix test case after r363401George Rimar2019-06-141-1/+1
| | | | llvm-svn: 363402
* Revert r363395.George Rimar2019-06-141-1/+1
| | | | | | It will not work because of r363394. llvm-svn: 363398
* [ELF] - Attemp to fix BB.George Rimar2019-06-141-1/+1
| | | | | | | | Seems section has a wrong type. http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/28 llvm-svn: 363395
* [lld][ELF] Add tests for bad subsection length in .ARM.attributesEugene Leviant2019-06-132-0/+16
| | | | | | Differential revision: https://reviews.llvm.org/D63191 llvm-svn: 363261
* [ELF] Implement General Dynamic style TLSDESC for x86-64Fangrui Song2019-05-291-0/+15
| | | | | | | | | | | This handles two initial relocation types R_X86_64_GOTPC32_TLSDESC and R_X86_64_TLSDESC_CALL, as well as the GD->LE and GD->IE relaxations. Reviewed By: ruiu Differential Revision: https://reviews.llvm.org/D62513 llvm-svn: 361911
* [LLD][ELF] - Remove symbol-name-offset.elf binary from test cases.George Rimar2019-05-073-7/+15
| | | | | | | It was possible to convert the test case to YAML test. After that, we have only one binary test left in LLD/ELF. llvm-svn: 360139
* [LLD][ELF] - Convert symbol-index.s testcase to a YAML test case. NFCI.George Rimar2019-04-253-10/+25
| | | | | | | | | | | | | | | This removes one more binary object from the inputs and fixes the test case description. Previously it said that: "symbol-index.elf has incorrect type of .symtab section. There is no symbol bodies because of that and any symbol index becomes incorrect." But the real reason of the failture was not the incorrect type of a symbol table, but invalid index of the symbol used in a relocation, what happened because previous test tried to read .symtab as a SHT_RELA section. llvm-svn: 359197
* [LLD][ELF] - Move the test to a correct folder, remove excessive input. NFCI.George Rimar2019-04-251-0/+51
| | | | | | | | | This test should live in `invalid` folder. Also it was possible to avoid adding input with use of `-docnum=x` yaml2obj argument. llvm-svn: 359194
* [LLD][ELF] - Remove binding.elf binary from test case. NFCI.George Rimar2019-04-243-7/+21
| | | | | | This introduces YAML based invalid-binding.test instead. llvm-svn: 359086
* [LLD][ELD] - Remove excessive lines from test. NFC.George Rimar2019-04-241-5/+0
| | | | | | They are not used. llvm-svn: 359084
* [LLD][ELF] - Remove dynamic-section-sh_size.elf binary, convert test to ↵George Rimar2019-04-233-4/+36
| | | | | | | | | | | | | yaml. NFCI. dynamic-section-sh_size.elf was introduced in D25090. Now it is possible to use yaml2obj instead. That is what this patch does. Also I added one more case of a possibly broken .dynamic section just in case. llvm-svn: 358990
* [LLD][ELF] - Remove file-class.a binary from inputs and improve the test case.George Rimar2019-04-233-4/+19
| | | | | | | | | | | | | file-class.a was used to diagnose the "corrupted ELF file: invalid file class" error when the object was fetched from the archive. file-class.a contained an object of 16 bytes size. I replaced it with an echo call (because it is impossible to use yaml2obj for that, and I am not sure it is worth to support), and also increased its size to 18 bytes. That allowed to also test a case when such object is a regular input and not an archive member (we have a bit different logic for these cases). llvm-svn: 358985
* [LLD][ELF] - Fix mips-invalid-options-descriptor.s test case and convert to ↵George Rimar2019-04-233-5/+21
| | | | | | | | | | | | | | YAML. It was initially introduced in D25229 to report the "zero option descriptor size" error message. In following commits it was broken and did not report this error anymore. I think that happened because elf object was a result of fuzzing and it was broken in many ways. This patch converts this test to a YAML, removes a binary and hence fixes the original intention. llvm-svn: 358972
* [LLD][ELF] - Remove multiple-eh-relocs.elf binary from the inputs. NFCI.George Rimar2019-04-233-4/+29
| | | | | | Introduced multiple-relocations-sections.test based on YAML instead. llvm-svn: 358966
* [LLD][ELF] - Remove a binary from the inputs. NFCI.George Rimar2019-04-223-4/+16
| | | | | | | section-index.elf was removed and the corresponding test was replaced with a yaml2obj based test. llvm-svn: 358889
* [LLD] - Update the test cases after yaml2obj change.George Rimar2019-04-0312-51/+49
| | | | | | | | | https://reviews.llvm.org/D60122 (r357595) changed the symbols description format. This change updates the LLD tests. llvm-svn: 357596
* [LLD][ELF] - Replace one of the tests with a YAML version.George Rimar2019-03-173-4/+17
| | | | | | | | This removes one more binary from the inputs. Differential revision: https://reviews.llvm.org/D59085 llvm-svn: 356334
* Make a hack for LTO work only when you are actually doing LTO.Rui Ueyama2019-03-141-1/+1
| | | | | | | | | | | | We allow an archive file without symbol table as a linker input as a workaround for a very common error in LTO build. But that logic worked even for an archive file containing non-bitcode files, which is not expected. This patch limits that workaround to one that contains only bitcode files. Differential Revision: https://reviews.llvm.org/D59373 llvm-svn: 356186
* Fix test to unconditionally create a GNU-format archive.Eli Friedman2019-03-121-1/+1
| | | | | | | On Darwin targets, llvm-ar creates a Darwin format archive by default, which ld.lld can't read, so it was printing an unexpected error. llvm-svn: 355894
* [ELF] Print a better error for an archive containing a non-ELF file.Eli Friedman2019-03-121-3/+10
| | | | | | | | | Hopefully gives a more readable error message for the most obvious mistake. Differential Revision: https://reviews.llvm.org/D59170 llvm-svn: 355888
* Include an archive file name in an error message for a corrupted file.Rui Ueyama2019-03-121-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D59212 llvm-svn: 355886
* [LLD][ELF] - Convert common-symbol-alignment.s test to yaml.George Rimar2019-03-064-12/+36
| | | | | | This removes 2 precompiled binaries from the inputs. llvm-svn: 355500
* [LLD][ELF] - Remove unused invalid input object. NFC.George Rimar2019-03-061-0/+0
| | | | | | | | It was introduced by me in 2016: r290335, but the test did contain the YAML from start, I think it was committed by mistake. llvm-svn: 355497
* [LLD][ELF] - Convert 3 testcases to use yaml instead of binaries.George Rimar2019-03-015-13/+59
| | | | | | | | This change makes 3 tests to use yaml instead of binaries. Differential revision: https://reviews.llvm.org/D58780 llvm-svn: 355196
* [LLD][ELF] - Convert invalid/undefined-local-symbol-in-dso.test to use YAMLGeorge Rimar2019-03-012-56/+17
| | | | | | | | This removes a binary from the inputs and reduces the test case. Differential revision: https://reviews.llvm.org/D58783 llvm-svn: 355194
* [LLD][ELF] - Stop using binary input in invalid/tls-symbol.s test. NFCI.George Rimar2019-02-282-3/+22
| | | | | | We can use yaml2obj instead, patch does this. llvm-svn: 355075
* [LLD][ELF] - Improve "sh_addralign is not a power of 2" diagnostics.George Rimar2019-02-272-5/+16
| | | | | | | | | | This patch removes the precompiled binary from inputs, replacing it with a YAML. And teaches LLD to report a section name in case of such error. Differential revision: https://reviews.llvm.org/D58670 llvm-svn: 354959
* [ELF][test]Remove unnecessary empty symbol references in yaml/add missing ↵James Henderson2019-02-221-0/+5
| | | | | | | | | | | | | | | | | | | symbols for relocs yaml2obj used to require the Symbol field in relocations, but it hasn't done so for a couple of years. Another change to yaml2obj will soon land that will look up the symbol by name or index, if present, and emit an error if not found. This will mean that an explicit symbol reference (even to an empty-named symbol) that does not reference a symbol declared in the yaml will result in an error. This patch updates tests that would otherwise start emitting errors. Reviewed by: ruiu, grimar Differential Revision: https://reviews.llvm.org/D58508 llvm-svn: 354666
* [LLD][ELF] - Simplify test case. NFC.George Rimar2019-02-211-7/+0
| | | | | | It has an excessive section declaration. llvm-svn: 354573
* [ELF] - Update test case after yaml2obj format change.George Rimar2019-02-191-1/+1
| | | | | | yaml2obj was changed in r354338("[yaml2obj][obj2yaml] - Support SHT_GNU_versym (.gnu.version) section.") llvm-svn: 354339
* Improve error message for unknown relocations.Rui Ueyama2019-02-142-3/+3
| | | | | | | | | | | | Previously, we showed the following message for an unknown relocation: foo.o: unrecognized reloc 256 This patch improves it so that the error message includes a symbol name: foo.o: unknown relocation (256) against symbol bar llvm-svn: 354040
* [LLD][ELF] - Update test case after yaml2obj change. NFCI.George Rimar2019-02-091-1/+4
| | | | | | | .dynamic section format accepted by yaml2obj was changed in r353606 llvm-svn: 353607
* [ELF] Fix typo. NFCShoaib Meenai2018-10-041-1/+1
| | | | llvm-svn: 343748
* [ELF] Fix crash on invalid undefined local symbolsShoaib Meenai2018-10-032-0/+66
| | | | | | | | | | | | | | | | | | | | r320770 made LLD handle invalid DSOs where local symbols were found in the global part of the symbol table. Unfortunately, it didn't handle the case where those local symbols were also undefined, and r326242 exposed an assertion failure in that case. Just warn on that case instead of crashing, by moving the local binding check before the undefined symbol addition. The input file for the test is crafted by hand, since I don't know of any tool that would produce such a broken DSO. I also don't understand what it even means for a symbol to be undefined but have STB_LOCAL binding - I don't think that combination makes any sense - but we have found broken DSOs of this nature that we were linking against. I've included detailed instructions on how to produce the DSO in the test. Differential Revision: https://reviews.llvm.org/D52815 llvm-svn: 343745
* [ELF] Check if LinkSec is nullptr when initializing SHF_LINK_ORDER sectionsFangrui Song2018-09-071-0/+16
| | | | | | | | | | | | | | Summary: This protects lld from a null pointer dereference when a faulty input file has such invalid sh_link fields. Reviewers: ruiu, espindola Reviewed By: ruiu Subscribers: emaste, arichardson, llvm-commits Differential Revision: https://reviews.llvm.org/D51743 llvm-svn: 341611
* [LLD][ELF] - Add a test case for DT_SONAME entry reading.George Rimar2018-08-161-0/+18
| | | | | | | This covers a following line with a test: https://github.com/llvm-mirror/lld/blob/master/ELF/InputFiles.cpp#L899 llvm-svn: 339880
* [LLD][ELF] - Add a test case.George Rimar2018-08-161-0/+16
| | | | | | | This covers the following line with a test: https://github.com/llvm-mirror/lld/blob/master/ELF/InputFiles.cpp#L487 llvm-svn: 339876
* [LLD][ELF] - Add test case.George Rimar2018-08-161-0/+22
| | | | | | | To cover the following error message: https://github.com/llvm-mirror/lld/blob/master/ELF/InputFiles.cpp#L463 llvm-svn: 339867
* [LLD][ELF] - Stop using binary input in merge-invalid-size.s test. NFCI.George Rimar2018-08-153-3/+21
| | | | | | This rewrites the test using yaml. llvm-svn: 339775
* [LLD][ELF] - Convert binary input to yaml in sht-group.s test. NFC.George Rimar2018-08-153-3/+18
| | | | | | This removes test that used binary input and adds a yaml based test instead. llvm-svn: 339774
* [LLD][ELF] - Handle SHT_GROUP more carefully. NFCI.George Rimar2018-08-151-0/+25
| | | | | | | | | | | | This patch solves 2 problems: 1) It adds a test to check the line below: https://github.com/llvm-mirror/lld/blob/master/ELF/InputFiles.cpp#L334 Test case contains SHT_GROUP section with a broken (0xFF) flag. 2) The patch fixes the case when we silently accepted such broken groups in the case when there were no other objects with the same group signature. llvm-svn: 339765
* [LLD][ELF] - Eliminate dead code from OffsetGetter::get().George Rimar2018-08-141-0/+31
| | | | | | | | | We have a dead piece of code there which is impossible to trigger using regular objects I believe. Patch removes it and adds a test case showing how this condition can be triggered with use of a broken object and crash the linker. llvm-svn: 339680
* [LLD][ELF] - Added test case for non-nullterminated wide strings.George Rimar2018-08-071-0/+19
| | | | | | | This covers the following line: https://github.com/llvm-mirror/lld/blob/master/ELF/InputSection.cpp#L1032 llvm-svn: 339124
* [ELF] Replace unused output filenames with /dev/null in testsFangrui Song2018-07-0211-12/+12
| | | | | | Post commit review at rLLD335992 llvm-svn: 336129
OpenPOWER on IntegriCloud