summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object
Commit message (Collapse)AuthorAgeFilesLines
* [llvm-readelf/llvm-readobj] - Improved the error reporting in a few method ↵Georgii Rymar2019-12-101-2/+2
| | | | | | | | | | | | | | | | | | related to versioning. I was investigating a change previously discussed that eliminates an excessive empty lines from the output when we report warnings and errors (https://reviews.llvm.org/D70826#inline-639055) and found that we need this refactoring or alike to achieve that. The problem is that some of our functions that finds symbol versions just fail instead of returning errors or printing warnings. Another problem is that they might print a warning on the same line with the regular output. In this patch I've splitted getting of the version information and dumping of it for GNU printVersionSymbolSection(). I had to change a few methods to return Error or Expected<> to do that properly. Differential revision: https://reviews.llvm.org/D71118
* [test][tools] Add missing and improve testingJames Henderson2019-12-091-0/+4
| | | | | | | | | | | Mostly this adds testing for certain aliases in more explicit ways. There are also a few tidy-ups, and additions of missing testing, where the feature was either not tested at all, or not tested explicitly and sufficiently. Reviewed by: MaskRay, rupprecht, grimar Differential Revision: https://reviews.llvm.org/D71116
* [llvm-readobj][llvm-readelf] - Refactor parsing of the SHT_GNU_versym section.Georgii Rymar2019-12-062-5/+10
| | | | | | | This introduce a new helper which is used to parse the SHT_GNU_versym section. LLVM/GNU styles implementations now use it to share the logic. Differential revision: https://reviews.llvm.org/D71054
* [Object/ELF] - Refine the error reported when section's offset + size ↵Georgii Rymar2019-12-031-4/+4
| | | | | | | | | | | | | | | overruns the file buffer. This is a follow-up requested in comments for D70826. It changes the message from "section X has a sh_offset (Y) + sh_size (Z) that cannot be represented" to "section X has a sh_offset (Y) + sh_size (Z) that is greater than the file size (0xABC)" when section's sh_offset + sh_size overruns a file buffer. Differential revision: https://reviews.llvm.org/D70893
* [llvm-objdump] Print relocation addends in hexadecimalDavid Bozier2019-11-192-9/+9
| | | | | | | | | | | | | | Summary: Matches GNU objdump. Makes debugging easier for me as I'm working out addresses from symbol+addend, so it would be good to be calculating in a single format. Reviewers: MaskRay, grimar, jhenderson, bd1976llvm Reviewed By: jhenderson Subscribers: sdardis, jrtc27, atanasyan, rupprecht, seiya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69997
* Fix a print error found while testing llvm-objcopyAaron Smith2019-11-181-2/+2
| | | | A value was not printed as hex. This updates the output and test cases.
* [Object][MachO] Rewrite macho-invalid-fat-arch-size into YAMLSteven Wu2019-11-063-2/+14
| | | | | | | | | | | | | | | | | | | | | | Summary: Rewrite one of the invalid macho test input file with YAML file. The original invalid macho is breaking our internal test infrastusture because it is too broken to be copy around. Need to relax an assertion in the YAML/MachoEmitter to allow yaml2obj to write an invalid object like this. rdar://problem/56879982 Reviewers: beanz, mtrent Reviewed By: beanz Subscribers: hiraditya, jkorous, dexonsmith, ributzka, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69856
* Revert "[Object][MachO] Rewrite macho-invalid-fat-arch-size into YAML"Steven Wu2019-11-053-14/+2
| | | | The invalid binary trying to construct triggers an assertion.
* [Object][MachO] Rewrite macho-invalid-fat-arch-size into YAMLSteven Wu2019-11-053-2/+14
| | | | | | | | Rewrite one of the invalid macho test input file with YAML file. The original invalid macho is breaking our internal test infrastusture because it is too broken to be copy around. rdar://problem/56879982
* [llvm-readobj] Change errors to warnings for symbol section name dumpingJames Henderson2019-11-041-3/+4
| | | | | | | | | | | | | | | Also only print each such warning once. LLVM-style output will now print "<?>" for sections it cannot identify, e.g. because the section index is invalid. GNU output continues to print the raw index. In both cases where the st_shndx value is SHN_XINDEX and the index cannot be looked up in the SHT_SYMTAB_SHNDX section (e.g. because it is missing), the symbol is printed like other symbols with st_shndx >= SHN_LORESERVE. Reviewed by: grimar, MaskRay Differential Revision: https://reviews.llvm.org/D69671
* [yaml2obj] - Make .symtab to be not mandatory section for SHT_REL[A] section.Georgii Rymar2019-10-292-0/+2
| | | | | | | | | | | | | | Before this change .symtab section was required for SHT_REL[A] section declarations. yaml2obj automatically defined it in case when YAML document did not have it. With this change it is now possible to produce an object that has a relocation section, but has no symbol table. It simplifies the code and also it is inline with how we handle Link fields for another special sections. Differential revision: https://reviews.llvm.org/D69260
* [llvm/Object] - Fix the error message reported for a broken SHT_SYMTAB_SHNDX ↵georgerim2019-10-251-1/+1
| | | | | | | | | | | | | | section. SHT_SYMTAB_SHNDX should have the same number of entries as the symbol table associated (https://www.sco.com/developers/gabi/latest/ch4.sheader.html) We currently can report the following message: "SHT_SYMTAB_SHNDX section has sh_size (24) which is not equal to the number of symbols (2)" It is just broken. This patch refines/fixes it. Differential revision: https://reviews.llvm.org/D69305
* [yaml2obj][obj2yaml] - Do not create a symbol table by default.George Rimar2019-10-202-4/+5
| | | | | | | | | | | | | | | | | | This patch tries to resolve problems faced in D68943 and uses some of the code written by Konrad Wilhelm Kleine in that patch. Previously, yaml2obj tool always created a .symtab section. This patch changes that. With it we only create it when have a "Symbols:" tag in the YAML document or when we need to create it because it is used by another section(s). obj2yaml follows the new behavior and does not print "Symbols:" anymore when there is no symbol table. Differential revision: https://reviews.llvm.org/D69041 llvm-svn: 375361
* [WebAssembly] Allow multivalue signatures in object filesThomas Lively2019-10-182-2/+3
| | | | | | | | | | | | | | | | | Summary: Also changes the wasm YAML format to reflect the possibility of having multiple return types and to put the returns after the params for consistency with the binary encoding. Reviewers: aheejin, sbc100 Subscribers: dschuff, jgravelle-google, hiraditya, sunfish, arphaman, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69156 llvm-svn: 375283
* [llvm-ar] Implement the O modifier: display member offsets inside the archiveFangrui Song2019-10-172-0/+17
| | | | | | | | | | | | Since GNU ar 2.31, the 't' operation prints member offsets beside file names if the 'O' modifier is specified. 'O' is ignored for thin archives. Reviewed By: gbreynoo, ruiu Differential Revision: https://reviews.llvm.org/D69087 llvm-svn: 375106
* [llvm-readobj] - Refine the LLVM-style output to be consistent.George Rimar2019-10-171-2/+2
| | | | | | | | | | | | | | Our LLVM-style output was inconsistent. This patch changes the output in the following way: SHT_GNU_verdef { -> VersionDefinitions [ SHT_GNU_verneed { -> VersionRequirements [ Version symbols [ -> VersionSymbols [ EH_FRAME Header [ -> EHFrameHeader { Differential revision: https://reviews.llvm.org/D68636 llvm-svn: 375095
* Reapply: [llvm-size] Tidy up error messages (PR42970)Jordan Rupprecht2019-10-141-2/+2
| | | | | | | | | | | | Clean up some formatting inconsistencies in the error messages and correctly exit with non-zero in all error cases. Originally submitted as r374771 and then reverted as r374780, this patch fixes the libObject test case in Object/macho-invalid.test. Patch by Alex Cameron Differential Revision: https://reviews.llvm.org/D68906 llvm-svn: 374793
* [mips] Use llvm-readobj `-A` flag in test cases. NFCSimon Atanasyan2019-10-031-1/+1
| | | | llvm-svn: 373589
* [llvm-ar][test] Move MRI tests from "llvm/test/Object/"Owen Reynolds2019-09-269-124/+0
| | | | | | | | | | llvm/test/Object/ contains tests for the ArchiveWriter library, however support for MRI scripts is found in llvm-ar and not the library. This diff moves the MRI related tests and removes those that are duplicates. Differential Revision: https://reviews.llvm.org/D68038 llvm-svn: 372973
* Reapply [llvm-ar] Include a line number when failing to parse an MRI scriptOwen Reynolds2019-09-203-3/+3
| | | | | | | | | | | Reapply r372309 Errors that occur when reading an MRI script now include a corresponding line number. Differential Revision: https://reviews.llvm.org/D67449 llvm-svn: 372374
* [llvm-ar] Uncapitalize error messages and delete full stopFangrui Song2019-09-147-7/+7
| | | | | | | | | | | | Most GNU binutils don't append full stops in error messages. This convention has been adopted by a bunch of LLVM binary utilities. Make llvm-ar follow the convention as well. Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D67558 llvm-svn: 371912
* Revert [llvm-nm] Add tapi file supportCyndy Ishida2019-09-118-225/+0
| | | | | | This reverts r371576 (git commit f88f46358dbffa20af3b054a9346e5154789d50f) llvm-svn: 371676
* Revert [Object][TextAPI] NFC, fix tapi lit testsCyndy Ishida2019-09-112-6/+6
| | | | | | This reverts r371577 (git commit b2b0ccab2f76733679eeceecf31b21ebc1fe23ac) llvm-svn: 371674
* [Object][TextAPI] NFC, fix tapi lit testsCyndy Ishida2019-09-112-6/+6
| | | | | | FileCheck command had wrong casing, which works fine on macOS, repairs the linux build bots llvm-svn: 371577
* [llvm-nm] Add tapi file supportCyndy Ishida2019-09-118-0/+225
| | | | | | | | | | | | | | | | | | Summary: This commit is the final one for adding tapi support to the llvm-nm implementation. This commit also has accompanying tests the additions to lib/Object Reviewers: ributzka, steven_wu Reviewed By: ributzka Subscribers: hiraditya, plotfi, dexonsmith, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66160 llvm-svn: 371576
* [yaml2obj] Rename SHOffset (e_shoff) field to SHOff. NFCFangrui Song2019-09-061-2/+2
| | | | | | | | | | | `struct Elf*_Shdr` has a field `sh_offset`, named `ShOffset` in llvm::ELFYAML::Section. Rename SHOffset (e_shoff) to SHOff to prevent confusion. Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D67254 llvm-svn: 371185
* [yaml2obj] Write the section header table after section contentsFangrui Song2019-09-051-2/+2
| | | | | | | | | | | | | | | | | Linkers (ld.bfd/gold/lld) place the section header table at the very end. This allows tools to strip it, which is optional in executable/shared objects. In addition, if we add or section, the size of the section header table will change. Placing the section header table in the end keeps section offsets unchanged. yaml2obj currently places the section header table immediately after the program header. Follow what linkers do to make offset updating easier. Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D67221 llvm-svn: 371074
* [llvm-readobj/llvm-readelf] - Report a proper warning when dumping a broken ↵George Rimar2019-08-291-1/+1
| | | | | | | | | | | | | dynamic relocation. When we have a dynamic relocation with a broken symbol's st_name, tools report a useless error: "Invalid data was encountered while parsing the file". After this change we report a warning + "<corrupt>" as a symbol name. Differential revision: https://reviews.llvm.org/D66734 llvm-svn: 370330
* [llvm-objdump] - Cleanup the error reporting.George Rimar2019-08-211-1/+1
| | | | | | | | | | | | | | | | | | | The error reporting function are not consistent. Before this change: * They had inconsistent naming (e.g. 'error' vs 'report_error'). * Some of them reported the object name, others - dont. * Some of them accepted the case when there was no error. (i.e. error code or Error had a success value). This patch tries to cleanup it a bit. It also renames report_error -> reportError, report_warning -> reportWarning and removes a full stop from messages. Differential revision: https://reviews.llvm.org/D66418 llvm-svn: 369515
* [test/Object] - Move/rewrite 2 more test cases.George Rimar2019-08-203-12/+0
| | | | | | | | | | | | | | | This patch makes a change for test/Object tests responsible for relocations. * 2 tests were moved to llvm-readobj/llvm-objdump folders: Object/elf-reloc-no-sym.test -> tools/llvm-readobj/elf-reloc-no-sym.test Object/objdump-reloc-shared.test -> tools/llvm-objdump/relocations-in-nonreloc.test * A prerecompiled binary was removed and these tests were refactored. Differential revision: https://reviews.llvm.org/D66291 llvm-svn: 369342
* Recommit r369190 "[llvm-readobj/llvm-readelf] - Improve/cleanup the error ↵George Rimar2019-08-171-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | reporting API." Fix: Add a `consumeError` call removed by mistake to 'printStackSize', this should fix the "Expected<T> must be checked before access or destruction." reported by following bot: http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/9743/steps/stage%201%20check/logs/stdio Original commit message: Currently we have the following functions for error reporting: LLVM_ATTRIBUTE_NORETURN void reportError(Twine Msg); void reportError(Error Err, StringRef Input); void reportWarning(Twine Msg); void reportWarning(StringRef Input, Error Err); void warn(llvm::Error Err); void error(std::error_code EC); Problems are: naming is inconsistent, arguments order is inconsistent, some of the functions looks excessive. After applying this patch we have: void reportError(Error Err, StringRef Input); void reportError(std::error_code EC, StringRef Input); void reportWarning(Error Err, StringRef Input); I'd be happy to remove reportError(std::error_code EC, StringRef Input) too, but it is used by COFF heavily. Test cases were updated, they show an improvement introduced. Differential revision: https://reviews.llvm.org/D66286 llvm-svn: 369194
* Revert r369190, r369192 ([llvm-readobj/llvm-readelf] - Improve/cleanup the ↵George Rimar2019-08-171-13/+13
| | | | | | | | | | | error reporting API.) It caused multiple BB failtures: http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/9743/steps/stage%201%20check/logs/stdio http://lab.llvm.org:8011/builders/clang-cmake-x86_64-sde-avx512-linux/builds/26042/steps/ninja%20check%201/logs/FAIL%3A%20LLVM%3A%3Astack-sizes.test llvm-svn: 369193
* [llvm-readobj/llvm-readelf] - Improve/cleanup the error reporting API.George Rimar2019-08-171-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | urrently we have the following functions for error reporting: -- LLVM_ATTRIBUTE_NORETURN void reportError(Twine Msg); void reportError(Error Err, StringRef Input); void reportWarning(Twine Msg); void reportWarning(StringRef Input, Error Err); void warn(llvm::Error Err); void error(std::error_code EC); --- Problems are: naming is inconsistent, arguments order is inconsistent, some of the functions looks excessive. After applying this patch we have: --- LLVM_ATTRIBUTE_NORETURN void reportError(Error Err, StringRef Input); LLVM_ATTRIBUTE_NORETURN void reportError(std::error_code EC, StringRef Input); void reportWarning(Error Err, StringRef Input); --- I'd be happy to remove reportError(std::error_code EC, StringRef Input) too, but it is used by COFF heavily. Test cases were updated, they show an improvement introduced. Differential revision: https://reviews.llvm.org/D66286 llvm-svn: 369190
* [test] - Remove precomiled openbsd-phdrs.elf-x86-64 objects.George Rimar2019-08-171-0/+0
| | | | | | | | | | | There are 2 similar openbsd-phdrs.elf-x86-64 objects committed and used in test/Object and test/tools/llvm-objdump test cases. There is no reason to have them, we can use YAML instead. Patch does that. Differential revision: https://reviews.llvm.org/D66342 llvm-svn: 369189
* [lib/Object] - Remove objdump-file-header.testGeorge Rimar2019-08-151-22/+0
| | | | | | | | | | objdump-file-header.test is placed in the wrong folder. I removed it and updated the existent llvm-objdump test cases with the updated content of the file removed. Differential revision: https://reviews.llvm.org/D66288 llvm-svn: 369004
* Recommit r368812 "[llvm/Object] - Convert SectionRef::getName() to return ↵George Rimar2019-08-141-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Expected<>" Changes: no changes. A fix for the clang code will be landed right on top. Original commit message: SectionRef::getName() returns std::error_code now. Returning Expected<> instead has multiple benefits. For example, it forces user to check the error returned. Also Expected<> may keep a valuable string error message, what is more useful than having a error code. (Object\invalid.test was updated to show the new messages printed.) This patch makes a change for all users to switch to Expected<> version. Note: in a few places the error returned was ignored before my changes. In such places I left them ignored. My intention was to convert the interface used, and not to improve and/or the existent users in this patch. (Though I think this is good idea for a follow-ups to revisit such places and either remove consumeError calls or comment each of them to clarify why it is OK to have them). Differential revision: https://reviews.llvm.org/D66089 llvm-svn: 368826
* Revert r368812 "[llvm/Object] - Convert SectionRef::getName() to return ↵George Rimar2019-08-141-11/+5
| | | | | | | | Expected<>" It broke clang BB: http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/16455 llvm-svn: 368813
* [llvm/Object] - Convert SectionRef::getName() to return Expected<>George Rimar2019-08-141-5/+11
| | | | | | | | | | | | | | | | | | | | | | | SectionRef::getName() returns std::error_code now. Returning Expected<> instead has multiple benefits. For example, it forces user to check the error returned. Also Expected<> may keep a valuable string error message, what is more useful than having a error code. (Object\invalid.test was updated to show the new messages printed.) This patch makes a change for all users to switch to Expected<> version. Note: in a few places the error returned was ignored before my changes. In such places I left them ignored. My intention was to convert the interface used, and not to improve and/or the existent users in this patch. (Though I think this is good idea for a follow-ups to revisit such places and either remove consumeError calls or comment each of them to clarify why it is OK to have them). Differential revision: https://reviews.llvm.org/D66089 llvm-svn: 368812
* [llvm-objdump] - Add a relocation-xindex-symbol.test test case.George Rimar2019-08-142-8/+0
| | | | | | | | | This rewrites the exitent test case to use YAML instead of the precompiled object and moves it from test/Object to an appropriate llvm-objdump tests folder. Differential revision: https://reviews.llvm.org/D66140 llvm-svn: 368811
* [llvm-readobj] Downgrade 'PT_DYNAMIC segment offset + size exceeds the size ↵Jordan Rupprecht2019-08-121-3/+3
| | | | | | | | | | | | | | | | | | of the file' from an error to a warning Summary: This allows llvm-readobj to print other useful information for truncated files instead of giving up. Reviewers: jhenderson, grimar, MaskRay Reviewed By: jhenderson, grimar, MaskRay Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66036 llvm-svn: 368576
* [llvm-readobj] - Remove deprecated unwrapOrError(Expected<T> EO).George Rimar2019-08-091-25/+25
| | | | | | | | | This patch changes the code to use a modern unwrapOrError(StringRef Input, Expected<T> EO) version that contains the input source name and removes the deprecated version. Differential revision: https://reviews.llvm.org/D65946 llvm-svn: 368428
* [yaml2obj/obj2yaml] - Add a basic support for extended section indexes.George Rimar2019-08-081-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | In some cases a symbol might have section index == SHN_XINDEX. This is an escape value indicating that the actual section header index is too large to fit in the containing field. Then the SHT_SYMTAB_SHNDX section is used. It contains the 32bit values that stores section indexes. ELF gABI says that there can be multiple SHT_SYMTAB_SHNDX sections, i.e. for example one for .symtab and one for .dynsym (1) https://groups.google.com/forum/#!topic/generic-abi/-XJAV5d8PRg (2) DT_SYMTAB_SHNDX: http://www.sco.com/developers/gabi/latest/ch5.dynamic.html In this patch I am only supporting a single SHT_SYMTAB_SHNDX associated with a .symtab. This is a more or less common case which is used a few tests I saw in LLVM. I decided not to create the SHT_SYMTAB_SHNDX section as "implicit", but implement is like a kind of regular section for now. i.e. tools do not recreate this section or its content, like they do for symbol table sections, for example. That should allow to write all kind of possible broken test cases for our needs and keep the output closer to requested. Differential revision: https://reviews.llvm.org/D65446 llvm-svn: 368272
* [llvm-readobj/libObject] - Introduce a custom warning handler for ↵George Rimar2019-08-081-2/+2
| | | | | | | | | | | | | | | | | | | | `ELFFile<ELFT>` methods. Currently, we have a code duplication in llvm-readobj which was introduced in D63266. The duplication was introduced to allow llvm-readobj to dump the partially broken object. Methods in ELFFile<ELFT> perform a strict validation of the inputs, what is itself good, but not for dumper tools, that might want to dump the information, even if some pieces are broken/unexpected. This patch introduces a warning handler which can be passed to ELFFile<ELFT> methods and can allow skipping the non-critical errors when needed/possible. For demonstration, I removed the duplication from llvm-readobj and implemented a warning using the new custom warning handler. It also deduplicates the strings printed, making the output less verbose. Differential revision: https://reviews.llvm.org/D65515 llvm-svn: 368260
* [obj2yaml] - MIPS: move and improve testing of the e_flagsGeorge Rimar2019-08-072-188/+0
| | | | | | | | | | | | | | Mips/elf-flags.yaml and Mips/elf-abi.yaml are tests that intention was to show that yaml2obj/obj2yaml are able to read/dump MIPS specific e_flags. They were not complete, contained an excessive YAML parts and were placed at a wrong location. I removed them and created the obj2yaml/elf-mips-eflags.yaml instead. Differential revision: https://reviews.llvm.org/D65807 llvm-svn: 368140
* [ELF.h] - Check the case when e_shstrndx=SHN_XINDEX, but the corresponding ↵George Rimar2019-08-071-0/+20
| | | | | | | | | | | | | | | | | | sh_link is broken. When e_shstrndx is equal to SHN_XINDEX, the index of the section string table section should be taken from the sh_link field of the section header at index 0. If sh_link is broken, e.g. contains an index that is larger than number of sections, then error is reported. This error message was untested before. Differential revision: https://reviews.llvm.org/D65391 llvm-svn: 368139
* [test/Object] - Cleanup the Object\obj2yaml.test a bit.George Rimar2019-08-062-10/+0
| | | | | | | | | | | | | | | This makes 2 changes: 1) Removes unwind-section.elf-x86-64 object and the corresponding test case, because SHT_X86_64_UNWIND is already tested here: https://github.com/llvm-mirror/llvm/blob/master/test/tools/obj2yaml/section-type.yaml 2) Removes/partially moves "No such file or directory" test, because we already have a similar test here: https://github.com/llvm-mirror/llvm/blob/master/test/tools/obj2yaml/invalid_input_file.test Differential revision: https://reviews.llvm.org/D65570 llvm-svn: 368044
* [llvm/test/Object] Remove redundant test case. NFCSimon Atanasyan2019-08-061-19/+0
| | | | | | | Remove redundant `yaml2obj-elf-file-headers-with-e_flags.yaml` test case. The same functionality is checked by the `Mips/elf-flags.yaml`. llvm-svn: 368023
* [llvm/test/Object] - Cleanup and move out the yaml2obj tests.George Rimar2019-08-0617-628/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are multiple yaml2obj-* tests in llvm/test/Object folder. This is not correct place to have them and my intention was to move them out to test\tools\yaml2obj folder. I reviewed them, made some changes, and my comments are below. For all tests I: Added comments when needed. Moved them from llvm/test/Object to yaml2obj tests. Another changes performed: 1) yaml2obj-invalid.yaml. It was a test for an invalid YAML input. I just moved it. 2) yaml2obj-coff-multi-doc.test/yaml2obj-elf-multi-doc.test: these were a tests for testing --docnum=x functionality, one was for COFF and one for ELF. I merged them into one. 3) yaml2obj-elf-bits-endian.test: I removed its 4 YAML inputs (merged into the main test). 4) yaml2obj-readobj.test: This file has a long history. It was added to check the "parsing of header charactestics" initially. Then was used to test how yaml2obj writes the relocations. Then was upgraded to check how yaml2obj handle "-o" option. I think it should be heavily splitted and refactored in a separate patch. For now I leaved it as is, but restyled to reduce the changes in a follow-ups. 5) yaml2obj-elf-alignment.yaml: its intention was to check we can set sh-addralign field. I moved, renamed (to elf-sh-addralign.yaml) and updated this test. 6) yaml2obj-elf-file-headers.yaml: I removed it. It's intention was to check that yaml2obj handles OS/ABI and ELF type (e.g Relocatable). We are testing this already, for example in D64800. We might want to add a better (more complete) test, but keeping the existent test does not have much sense I think. 7) yaml2obj-elf-file-headers-with-e_flags.yaml: I would describe its intention as "testing MIPS e_flags". It is far from being complete and tests only a few flags. I leaved it alone for now. 8) yaml2obj-elf-rel.yaml: its intention is to check the MIPS32 relocations. We have a version for MIPS64 here: test\Object\Mips\elf-mips64-rel.yaml Seems them both are incomplete. I leaved them alone for now. 9) yaml2obj-elf-rel-noref.yaml: was introduced to check the support of arm32 R_ARM_V4BX relocatiion. I leaved it alone for now. 10) yaml2obj-elf-section-basic.yaml: it just checked that we are able to recognise trivial fields like section 'Name', 'Type', 'Flags' and others. All of our yaml2obj tests are heavily using it. I just removed this test. 11) yaml2obj-elf-section-invalid-size.yaml: its intention was to check the "Section size must be greater than or equal to the content size" error. I moved this test to `tools\yaml2obj\section-size-content.yaml' 12) yaml2obj-elf-symbol-basic.yaml: its intention seems was to support declarations of the symbols in yaml2obj. I removed it. We use this in almost each test we already have. 13) yaml2obj-elf-symbol-LocalGlobalWeak.yaml: its intention was to check that we can declare different symbol bindings. I moved it to tools\yaml2obj\elf-symbol-binding.yaml. 14) yaml2obj-coff-invalid-alignment.test: check that error is reported for a too large coff section alignment. Moved it to tools\yaml2obj\coff-invalid-alignment.test 15) yaml2obj-elf-symbol-visibility.yaml: tests ELF symbols visibility. I improved it and moved to tools\yaml2obj\elf-symbol-visibility.yaml and tools\obj2yaml\elf-symbol-visibility.yaml Differential revision: https://reviews.llvm.org/D65652 llvm-svn: 367988
* [yaml2obj] - Allow overriding sh_entsize for SHT_GNU_versym sections.George Rimar2019-08-051-0/+25
| | | | | | | | | | | This allows to write a test case for one of untested errors in llvm/Object/ELF.h. I did it in this patch to demonstrate. Differential revision: https://reviews.llvm.org/D65394 llvm-svn: 367860
* [llvm/Object] - Add a test for "empty string table" error.George Rimar2019-07-311-0/+21
| | | | | | | | | | This error was never tested. In this patch I improved the error message, added the test case and also simplified the code that processes a similar error right below. Differential revision: https://reviews.llvm.org/D65396 llvm-svn: 367391
OpenPOWER on IntegriCloud