summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "[llvm-objdump] Add warning messages if disassembly + source for ↵Michael Pozulp2019-07-303-12/+6
| | | | | | | | | | problematic inputs" This reverts r367284 (git commit b1cbe51bdf44098c74f5c74b7bcd8c041a7c6772). My changes to LLVMSymbolizer caused a test to fail: http://lab.llvm.org:8011/builders/clang-ppc64be-linux-lnt/builds/29488 llvm-svn: 367286
* [llvm-objdump] Add warning messages if disassembly + source for problematic ↵Michael Pozulp2019-07-303-6/+12
| | | | | | | | | | | | | | | | | | inputs Summary: Addresses https://bugs.llvm.org/show_bug.cgi?id=41905 Reviewers: jhenderson, rupprecht, grimar Reviewed By: jhenderson, grimar Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62462 llvm-svn: 367284
* [llvm-lipo] Fix test on WindowsAnusha Basana2019-07-291-1/+1
| | | | | | | | | | Error message outputs with lowercase on Windows. Made test work on Widnows. For example: llvm-lipo: error: 'i386': no such file or directory llvm-svn: 367266
* [llvm-lipo] Implement -replaceAnusha Basana2019-07-295-0/+1567
| | | | | | | | | Replaces specified architecture in universal binary input file with slice from the file_name argument passed into the replace command. Differential Revision: https://reviews.llvm.org/D65247 llvm-svn: 367248
* [llvm-objcopy] Improve --add-section argument string parsingSergey Dmitriev2019-07-292-4/+25
| | | | | | Differential Revision: https://reviews.llvm.org/D65346 llvm-svn: 367236
* [obj2yaml] - Report a error when unable to resolve a sh_link reference properly.George Rimar2019-07-291-0/+58
| | | | | | | | | Because of a bug we did not report a error in the case shown in the test. With this patch we do. Differential revision: https://reviews.llvm.org/D65214 llvm-svn: 367203
* [llvm-objcopy] - Reimplement strip-dwo-groups.test to stop using the ↵George Rimar2019-07-292-35/+71
| | | | | | | | | | | | | | | | precompiled object. When llvm-copy removes .dwo sections the index of symbol table, the indices of the symbols and the indices of the sections which go after the removed ones changes. That affects on SHT_GROUP sections, which needs to be updated. Initially this test used a precompiled object, I rewrote it to use YAML and improved a bit. Differential revision: https://reviews.llvm.org/D65273 llvm-svn: 367202
* add 'a' to chmod in llvm-lipo executability testsBob Haarman2019-07-262-5/+5
| | | | | | | | | | | | | | | | | | | | | | | Summary: When specifying symbolic permissions with + or -, if none of a/u/g/o are specified, bits set in the umask are not affected. This caused the llvm-lipo executability tests to fail on some systems, e.g. having an umask of 027 would cause chmod -x to not clear the executable bit for others. This change instead uses chmod a-x, which clears all the executable bits regardless of umask. Reviewers: smeenai, hans, anushabasana Reviewed By: smeenai Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65342 llvm-svn: 367142
* [llvm-objcopy] Add support for --add-section for COFFSergey Dmitriev2019-07-261-0/+56
| | | | | | | | This patch enables support for --add-section=... option for COFF objects. Differential Revision: https://reviews.llvm.org/D65040 llvm-svn: 367130
* Recommit "rL366894: [yaml2obj] - Allow custom fields for the SHT_UNDEF ↵George Rimar2019-07-251-35/+71
| | | | | | | | | | | | | | | | | | sections." With fix: do not use `stat` tool. Original commit message: This is a follow-up refactoring patch for recently introduced functionality which which reduces the code duplication and also makes possible to redefine all possible fields of the first SHT_NULL section (previously it was only possible to set sh_link and sh_size). Differential revision: https://reviews.llvm.org/D65140 llvm-svn: 367003
* [llvm-lipo] Implement alignment function in -createShoaib Meenai2019-07-254-0/+467
| | | | | | | | | | | Summary: Removes hard coded valuse for alignment in -create. Patch by Anusha Basana <anusha.basana@gmail.com> Differential Revision: https://reviews.llvm.org/D64871 llvm-svn: 366970
* [llvm-lipo] Add test for -verify_archsShoaib Meenai2019-07-251-0/+1
| | | | | | | | | | | Add test to verify clean failure, exit code 1 for valid architecture not present in the universal binary. Patch by Anusha Basana <anusha.basana@gmail.com> Differential Revision: https://reviews.llvm.org/D65251 llvm-svn: 366968
* Revert "[yaml2obj] - Allow custom fields for the SHT_UNDEF sections."JF Bastien2019-07-241-71/+35
| | | | | | | It fails on macOS with the following error: https://reviews.llvm.org/D65140#1599522 llvm-svn: 366937
* [llvm-objdump] Emit warning if --start-address/--stop-address specify range ↵Yuanfang Chen2019-07-241-0/+200
| | | | | | | | | | | | | | | | | outside file's address range. NB: the warning is about the input file itself regardless of the options used such as `-r`, `-s` etc.. https://bugs.llvm.org/show_bug.cgi?id=41911 Reviewers: jhenderson, grimar, MaskRay, rupprecht Reviewed by: MaskRay, jhenderson Differential Revision: https://reviews.llvm.org/D64779 llvm-svn: 366923
* [llvm-ar][test] Fix move operation testsOwen Reynolds2019-07-242-17/+17
| | | | | | | This fixes two tests that did not remove existing archives before testing due to mistyped archive names. llvm-svn: 366908
* [llvm-objdump] - Import the test/Object/X86/no-start-symbol.test test case ↵George Rimar2019-07-241-0/+28
| | | | | | | | | | | | | | and rewrite it to use YAML. This patch removes test/Object/X86/no-start-symbol.test (rewrites it to use YAML and moves it to llvm-objdump tests folder). (This test was initially introduced in rL239039, but now there is no reason to keep the precompiled binary it seems). DIfferential revision: https://reviews.llvm.org/D65136 llvm-svn: 366896
* [Object/llvm-readobj] - Cleanup testing of the dynamic objects.George Rimar2019-07-244-10/+204
| | | | | | | | | | | | | | | | | | | | | | This patch touches a few test cases: It removes dtflags.elf-x86-64 binary and elf-dtflags.test. elf-dtflags.test is excessive because we have the elf-dynamic-tags.test which test all non-machine specific tags. It removes testing of --dynamic-table from test\Object\readobj-shared-object.test (we have the elf-dynamic-tags.test for that), and simplifies this test case. It moves testing of the headers from readobj-shared-object.test to elf-file-headers.test. Adds test/tools/llvm-readobj/elf-file-types.test and test/tools/llvm-readobj/elf-loadname.test. It opens road for removing the readobj-shared-object.test completely soon. Differential revision: https://reviews.llvm.org/D65068 llvm-svn: 366895
* [yaml2obj] - Allow custom fields for the SHT_UNDEF sections.George Rimar2019-07-241-35/+71
| | | | | | | | | | | | This is a follow-up refactoring patch for recently introduced functionality which which reduces the code duplication and also makes possible to redefine all possible fields of the first SHT_NULL section (previously it was only possible to set sh_link and sh_size). Differential revision: https://reviews.llvm.org/D65140 llvm-svn: 366894
* [yaml2obj] - Add a support for defining null sections in YAMLs.George Rimar2019-07-231-0/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | ELF spec shows (Figure 4-10: Section Header Table Entry:Index 0, http://www.sco.com/developers/gabi/latest/ch4.sheader.html) that section header at index 0 (null section) can have sh_size and sh_link fields set to non-zero values. It says (https://docs.oracle.com/cd/E19683-01/817-3677/6mj8mbtc9/index.html): "If the number of sections is greater than or equal to SHN_LORESERVE (0xff00), this member has the value zero and the actual number of section header table entries is contained in the sh_size field of the section header at index 0. Otherwise, the sh_size member of the initial entry contains 0." and: "If the section name string table section index is greater than or equal to SHN_LORESERVE (0xff00), this member has the value SHN_XINDEX (0xffff) and the actual index of the section name string table section is contained in the sh_link field of the section header at index 0. Otherwise, the sh_link member of the initial entry contains 0." At this moment it is not possible to create custom section headers at index 0 using yaml2obj. This patch implements this. Differential revision: https://reviews.llvm.org/D64913 llvm-svn: 366794
* [llvm-objcopy] Allow strip symtab in executables and DSOsEugene Leviant2019-07-235-87/+24
| | | | | | | Re-commit of the patch after addressing -Wl,--emit-relocs case. Differential revision: https://reviews.llvm.org/D61672 llvm-svn: 366787
* [yaml2elf] - Treat the SHN_UNDEF section as kind of regular section.George Rimar2019-07-231-2/+2
| | | | | | | | | | | | | | We have a logic that adds a few sections implicitly. Though the SHT_NULL section with section number 0 is an exception. In D64913 I want to teach yaml2obj to redefine the null section. And in this patch I add it to the sections list, to make it kind of a regular section. Differential revision: https://reviews.llvm.org/D65087 llvm-svn: 366785
* [llvm-lipo] Implement -infoShoaib Meenai2019-07-232-0/+50
| | | | | | | | | | Prints architecture type of all input files. Patch by Anusha Basana <anusha.basana@gmail.com> Differential Revision: https://reviews.llvm.org/D64668 llvm-svn: 366772
* [DWARF] Add more error handling to debug line parser.Jonas Devlieghere2019-07-222-2/+175
| | | | | | | | | | This patch exnteds the error handling in the debug line parser to get rid of the existing MD5 assertion. I want to reuse the debug line parser from LLVM in LLDB where we cannot crash on invalid input. Differential revision: https://reviews.llvm.org/D64544 llvm-svn: 366762
* llvm-objcopy/test: add REQUIRES: shell for use of umaskDavid Blaikie2019-07-222-0/+2
| | | | | | (follow-up to r365162) llvm-svn: 366755
* [llvm-readobj] - Stop using precompiled objects in file-headers.testGeorge Rimar2019-07-229-394/+624
| | | | | | | | This converts all sub-tests except one to YAML instead of precompiled inputs. Differential revision: https://reviews.llvm.org/D64800 llvm-svn: 366668
* [llvm-lipo] Remove trailing whitespace. NFCShoaib Meenai2019-07-196-41/+41
| | | | llvm-svn: 366595
* [llvm-readelf] - A fix for: "--hash-symbols asserts for 64-bit ELFs"George Rimar2019-07-191-3/+83
| | | | | | | | | Fixes https://bugs.llvm.org/show_bug.cgi?id=42622. (--hash-symbols switch is currently broken for 64-bit ELF files, due to r352630.) Differential revision: https://reviews.llvm.org/D64788 llvm-svn: 366558
* [test] [llvm-objcopy] Fix broken test caseAlex Brachet2019-07-191-8/+15
| | | | | | | | | | | | | | | | Summary: The test case added in D62718 did not work unless the user was root because write bits were not set for the output file. This change uses only permissions with user write (0200) to ensure tests pass regardless of the users permissions. Reviewers: jhenderson, rupprecht, MaskRay, espindola, alexshap Reviewed By: MaskRay Subscribers: emaste, arichardson, jakehehrlich, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64302 llvm-svn: 366527
* Reapply [llvm-lipo] Implement -create (with hardcoded alignments)Shoaib Meenai2019-07-186-0/+319
| | | | | | | | | | | | | | | | This reapplies r366142 with a fix for the failing Windows test. Original commit message: Creates universal binary output file from input files. Currently uses hard coded value for alignment. Want to get the create functionality approved before implementing the alignment function. Patch by Anusha Basana <anusha.basana@gmail.com> Differential Revision: https://reviews.llvm.org/D64102 llvm-svn: 366512
* [NFC][llvm-readobj] Refactor dynamic string table indexing into a function.Yuanfang Chen2019-07-181-18/+18
| | | | | | | | | | | | | Restore printDynamicString removed in rL363868. It provides better error handling whenever indexing dynamic string table is needed. Reviewers: jhenderson, MaskRay, grimar Reviewed by: jhenderson, MaskRay, grimar Differential Revision: https://reviews.llvm.org/D64674 llvm-svn: 366464
* [llvm-readelf] - Remove the precompiled binary from gnu-hash-symbols.testGeorge Rimar2019-07-183-104/+283
| | | | | | | | | | I am working on https://bugs.llvm.org/show_bug.cgi?id=42622 and this patch reworks the gnu-hash-symbols.test so that it will be easier to expand it with x86_64 case. Differential revision: https://reviews.llvm.org/D64750 llvm-svn: 366430
* llvm-pdbdump: Fix several smaller issues with injected source compression ↵Nico Weber2019-07-175-0/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | handling - getCompression() used to return a PDB_SourceCompression even though the docs for IDiaInjectedSource are explicit about the return value being compiler-dependent. Return an uint32_t instead, and make the printing code handle unknown values better by printing "Unknown" and the int value instead of not printing any compression. - Print compressed contents as hex dump, not as string. - Add compression type "DotNet", which is used (at least) by csc.exe, the C# compiler. Also add a lengthy comment describing the stream contents (derived from looking at the raw hex contents long enough to see the GUIDs, which led me to the roslyn and mono implementations for handling this). - The native injected source dumper was dumping the contents of the whole data stream -- but csc.exe writes a stream that's padded with zero bytes to the next 512 boundary, and the dia api doesn't display those padding bytes. So make NativeInjectedSource::getCode() do the same thing. Differential Revision: https://reviews.llvm.org/D64879 llvm-svn: 366386
* [llvm-ar][test] Add tests failing on DarwinOwen Reynolds2019-07-173-0/+125
| | | | | | | | | | These tests that failed on Darwin but passed on other machines due to the default archive format differing on a Darwin machine, and what looks to be bugs in the output of this format. I can not investigate these issue further so the tests are considered expected failures on Darwin. Differential Revision: https://reviews.llvm.org/D64802 llvm-svn: 366334
* [llvm-ar][test] \r\n -> \nFangrui Song2019-07-1717-1167/+1164
| | | | | | Also simplify some empty output tests with 'count 0' llvm-svn: 366324
* [llvm-ar][test] Add coverage for replace and update key lettersOwen Reynolds2019-07-172-0/+367
| | | | | | | | Some more tests to increase llvm-ar test coverage, this time for replace 'r' and update 'u'. Differential Revision: https://reviews.llvm.org/D64803 llvm-svn: 366309
* Teach `llvm-pdbutil pretty -native` about `-injected-sources`Nico Weber2019-07-161-0/+30
| | | | | | | | | `pretty -native -injected-sources -injected-source-content` works with this patch, and produces identical output to the dia version. Differential Revision: https://reviews.llvm.org/D64428 llvm-svn: 366236
* Revert [tools] [llvm-nm] Default to reading from stdin not a.outAlex Brachet2019-07-161-33/+0
| | | | | | This reverts r365889 (git commit 60c81354b1d3fced1bd284d334f118d2d792ab4b) llvm-svn: 366219
* [llvm-ar][test] Add to llvm-ar test coverageOwen Reynolds2019-07-163-0/+252
| | | | | | | | | This change adds tests to cover existing llvm-ar functionality. print.test is omitted due to failing on Darwin. Differential Revision: https://reviews.llvm.org/D64330 llvm-svn: 366209
* Reapply [llvm-ar][test] Increase llvm-ar test coverageOwen Reynolds2019-07-169-18/+413
| | | | | | | | This reapplies 365316 without extract.test due to failing on Darwin. Differential Revision: https://reviews.llvm.org/D63935 llvm-svn: 366206
* [Object/llvm-readelf/llvm-readobj] - Improve error reporting when e_shstrndx ↵George Rimar2019-07-161-0/+26
| | | | | | | | | | | | | | | | | | is broken. When e_shstrndx is broken, it is impossible to get a section name. In this patch I improved the error message we show and added tests for Object and for llvm-readelf/llvm-readobj Message was changed in two places: 1) llvm-readelf/llvm-readobj previously used a code from Object/ELF.h, now they have a modified version of it (it has less checks and allows dumping broken things). 2) Code in Object/ELF.h is still used for generic cases. Differential revision: https://reviews.llvm.org/D64714 llvm-svn: 366203
* Reapply [llvm-ar][test] Add to MRI test coverageOwen Reynolds2019-07-164-0/+139
| | | | | | | | This reapplies 363232 without mri-utf8.test due to failing on Darwin. Differential Revision: https://reviews.llvm.org/D63197 llvm-svn: 366201
* [llvm-readelf] Print "File: lib.a(file.o)" info when dumping archive files.Yuanfang Chen2019-07-154-15/+37
| | | | | | | | | | | | | | Match GNU readelf. https://bugs.llvm.org/show_bug.cgi?id=35351 Reviewers: jhenderson, grimar, MaskRay, rupprecht Reviewed by: jhenderson, MaskRay, grimar Differential Revision: https://reviews.llvm.org/D64361 llvm-svn: 366147
* Revert [llvm-lipo] Implement -create (with hardcoded alignments)Shoaib Meenai2019-07-157-318/+1
| | | | | | | | | This reverts r366142 (git commit 67cee1dc7ee285b03372eb818a3894d35efa7394) The test is failing on the Windows buildbots. Reverting while I investigate. llvm-svn: 366144
* [llvm-lipo] Implement -create (with hardcoded alignments)Shoaib Meenai2019-07-157-1/+318
| | | | | | | | | | | | Creates universal binary output file from input files. Currently uses hard coded value for alignment. Want to get the create functionality approved before implementing the alignment function. Patch by Anusha Basana <anusha.basana@gmail.com> Differential Revision: https://reviews.llvm.org/D64102 llvm-svn: 366142
* Recommit r366052 "[obj2yaml] - Rework tool's error reporting logic for ELF ↵George Rimar2019-07-152-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | target." No changes, LLD code was updated in r366057. Original commit message: ELF.h contains two getSymbol methods which seems to be used only from obj2yaml. One of these methods calls another, which in turn contains untested error message which doesn't provide enough information. Problem is that after improving only just that message, obj2yaml will not show it, ("Error reading file: yaml: Invalid data was encountered while parsing the file" message will be shown instead), because internal errors handling of tool is based on ErrorOr<> class which stores a error code and as a result can only show a predefined error string, what actually isn't very useful. In this patch, I rework obj2yaml's error reporting system for ELF targets to use Error Expected<> classes. Also, I improve the error message produced by getSymbol for demonstration of the new functionality. Differential revision: https://reviews.llvm.org/D64631 llvm-svn: 366058
* Revert r366052 "[obj2yaml] - Rework tool's error reporting logic for ELF ↵George Rimar2019-07-152-24/+2
| | | | | | | | | target." Seems it broke LLD: http://lab.llvm.org:8011/builders/sanitizer-windows/builds/48434 llvm-svn: 366053
* [obj2yaml] - Rework tool's error reporting logic for ELF target.George Rimar2019-07-152-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | ELF.h contains two getSymbol methods which seems to be used only from obj2yaml. One of these methods calls another, which in turn contains untested error message which doesn't provide enough information. Problem is that after improving only just that message, obj2yaml will not show it, ("Error reading file: yaml: Invalid data was encountered while parsing the file" message will be shown instead), because internal errors handling of tool is based on ErrorOr<> class which stores a error code and as a result can only show a predefined error string, what actually isn't very useful. In this patch, I rework obj2yaml's error reporting system for ELF targets to use Error Expected<> classes. Also, I improve the error message produced by getSymbol for demonstration of the new functionality. Differential revision: https://reviews.llvm.org/D64631 llvm-svn: 366052
* [test/Object, obj2yaml] - Move test cases from test/Object and cleanup.George Rimar2019-07-126-0/+439
| | | | | | | | | | | | | | | test/Object is not correct place to have tests that check obj2yaml functionality, because we have test/tools/obj2yaml folder for that. In this patch I merged a few test cases with their YAMLs from Inputs folder, converted one of binary inputs and moved them to tools/obj2yaml folder. There are still another tests that might need the same, so it is initial step. Differential revision: https://reviews.llvm.org/D64555 llvm-svn: 365891
* [tools] [llvm-nm] Default to reading from stdin not a.outAlex Brachet2019-07-121-0/+33
| | | | | | | | | | | | | | | | Summary: This moves away from defaulting to a.out and uses stdin only if stdin has a file redirected to it. This has been discussed on the llvm-dev mailing list [[ https://lists.llvm.org/pipermail/llvm-dev/2019-July/133642.html | here ]]. Reviewers: jhenderson, rupprecht, MaskRay, chrisjackson Reviewed By: jhenderson, MaskRay Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64290 llvm-svn: 365889
* Revert "[DwarfDebug] Dump call site debug info"Djordje Todorovic2019-07-121-76/+0
| | | | | | | | A build failure was found on the SystemZ platform. This reverts commit 9e7e73578e54cd22b3c7af4b54274d743b6607cc. llvm-svn: 365886
OpenPOWER on IntegriCloud