summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* Write new tests for r362121Michael Trent2019-05-305-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The tests for r362121 ran dsymutil against a test binary every time. This caused problems on lld-x86_64-ubuntu-fast as dsymutil required a lipo tool be available to process those binaries. This change rewrites the new test cases in macho-disassemble-g-dsym to use bespoke test binaries (exe and dwarf) simplifying the test's runtime dependencies. The changes to tools/llvm-objdump/MachODump.cpp are unchanged from r362121 Reviewers: pete, lhames, JDevlieghere Reviewed By: pete Subscribers: smeenai, aprantl, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62694 llvm-svn: 362141
* Reverting change r362121 due to lld-x86_64-ubuntu-fast test failuresMichael Trent2019-05-301-11/+0
| | | | llvm-svn: 362123
* Support Universal dSYM files in llvm-objdumpMichael Trent2019-05-301-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Commonly programmers use llvm-objdump to disassemble Mach-O target binaries with Mach-O dSYMS. While llvm-objdump allows programmers to disassemble Universal binaries, it previously did not recognize Universal dSYM files. This change updates llvm-objdump to support passing in Universal files via the -dsym option. Now, when disassembling a Mach-O file either as a stand alone file or as an entry in a Universal binariy, llvm-objdump will search through a Universal dSYM for a Mach-O matching the architecture flag of the file being disassembled. Reviewers: pete, lhames Reviewed By: pete Subscribers: rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62642 llvm-svn: 362121
* [llvm-readobj] - Rewrite reloc-types.test to use YAML. NFCI.George Rimar2019-05-3021-699/+1843
| | | | | | | | | | | | | | | | | | | | | | This change rewrites and splits reloc-types.test to use yaml2obj instead of precompiled binaries. That allowed to remove 7 precompiled objects from the inputs. I took the existent objects, used obj2yaml on them, simplified the result and used yaml2obj in the test case with the result. Notes: * I converted, but did not remove relocs.obj.elf-i386, relocs.obj.elf-x86_64 or relocs.obj.elf-mips objects because found they are used in other tests. * I was unable to convert relocs.obj.elf-ppc64, because obj2yaml hangs on this file for me. * I was unable to convert relocs.obj.macho-arm, relocs.obj.macho-i386 and relocs.obj.macho-x86_64 because the output produced by obj2yaml does not seem to be correct. * Because of the above I did not remove the script for creating all of those objects: test\tools\llvm-readobj\Inputs\relocs.py Differential revision: https://reviews.llvm.org/D62594 llvm-svn: 362089
* [llvm-readobj/llvm-readelf] - Implement GNU style dumper of the ↵George Rimar2019-05-301-3/+9
| | | | | | | | | | | SHT_GNU_verdef section. It was not implemented yet, we had only LLVM style dumper implemented. Section description is here: https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/symversion.html Differential revision: https://reviews.llvm.org/D62520 llvm-svn: 362082
* [llvm-readobj/llvm-readelf] - Implement GNU style dumper of the ↵George Rimar2019-05-302-3/+117
| | | | | | | | | | | SHT_GNU_verneed section. It was not implemented yet, we had only LLVM style dumper implemented. Section description is here: https://refspecs.linuxfoundation.org/LSB_2.0.1/LSB-Core/LSB-Core/symverrqmts.html Differential revision: https://reviews.llvm.org/D62516 llvm-svn: 362080
* [llvm-objcopy] Remove %p format specifiersEugene Leviant2019-05-301-3/+3
| | | | | | | On 32-bit machines %p expects 32 bit values, however addresses in llvm-objcopy are always 64 bits. llvm-svn: 362074
* Yet another attempt to fix buildbot after r361949Eugene Leviant2019-05-291-3/+3
| | | | | | | Looks like %p format specifier of createStringError behaves differently on different platforms llvm-svn: 361993
* [llvm-objcopy] Implement IHEX writerEugene Leviant2019-05-295-0/+260
| | | | | | Differential revision: https://reviews.llvm.org/D60270 llvm-svn: 361949
* [llvm-readobj] - Repair the test case.George Rimar2019-05-291-2/+2
| | | | | | | I forgot to change the test tag in r361932. Now it is fixed. llvm-svn: 361945
* [llvm-readelf] - Allow dumping of the .dynamic section even if there is no ↵George Rimar2019-05-293-11/+27
| | | | | | | | | | | | | PT_DYNAMIC header. It is now possible after D61937 was landed and was discussed in it's review comments. It is not consistent with GNU, which does not output .dynamic section content in this case for no visible reason. Differential revision: https://reviews.llvm.org/D62179 llvm-svn: 361943
* [llvm-readobj/llvm-readelf] - Simplify the elf-versioninfo.test test case.George Rimar2019-05-293-125/+173
| | | | | | | | | | This removes 2 precompiled objects from the test case and replaces them with a single YAML. That allowed to simplify and clean up the test, remove excessive checks. Differential revision: https://reviews.llvm.org/D62529 llvm-svn: 361932
* [llvm-readobj] -u: don't crash when dumping SHT_ARM_EXIDX if .symtab doesn't ↵Fangrui Song2019-05-291-80/+83
| | | | | | | | | | exist Reviewed By: kongyi Differential Revision: https://reviews.llvm.org/D62567 llvm-svn: 361929
* [tools] Introduce llvm-lipoAlexander Shaposhnikov2019-05-283-0/+88
| | | | | | | | | | | This diff starts the implementation of llvm-lipo which is supposed to be a drop-in replacement for the well-known tool lipo. Test plan: make check-all Differential revision: https://reviews.llvm.org/D61927 llvm-svn: 361896
* [XCOFF] Implement parsing symbol table for xcoffobjfile and output as yaml ↵Jason Liu2019-05-282-7/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | format Summary: This patch implement parsing symbol table for xcoffobjfile and output as yaml format. Parsing auxiliary entries of a symbol will be in a separate patch. The XCOFF object file (aix_xcoff.o) used in the test comes from -bash-4.2$ cat test.c extern int i; extern int TestforXcoff; int main() { i++; TestforXcoff--; } Patch by DiggerLin Reviewers: sfertile, hubert.reinterpretcast, MaskRay, daltenty Differential Revision: https://reviews.llvm.org/D61532 llvm-svn: 361832
* Fix some llvm-readelf tests after r361633Hans Wennborg2019-05-282-2/+2
| | | | | | | | They were failing on 32-bit Windows. In the cases where I've changed test expectations, I've checked that they match the output of GNU readelf. llvm-svn: 361807
* Make llvm-as --help great againSerge Guelton2019-05-272-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a follow-up to https://reviews.llvm.org/D60411, but for llvm-as. New output: OVERVIEW: llvm .ll -> .bc assembler USAGE: llvm-as [options] <input .llvm file> OPTIONS: Generic Options: -help - Display available options (-help-hidden for more) -help-list - Display list of available options (-help-list-hidden for more) -version - Display the version of this program llvm-as Options: -data-layout=<layout-string> - data layout string to use -disable-output - Disable output -f - Enable binary output on terminals -module-hash - Emit module hash -o=<filename> - Override output filename Differential Revision: https://reviews.llvm.org/D60603 llvm-svn: 361750
* [MCA][Scheduler] Improved critical memory dependency computation.Andrea Di Biagio2019-05-261-1/+1
| | | | | | | | This fixes a problem where back-pressure increases caused by register dependencies were not correctly notified if execution was also delayed by memory dependencies. llvm-svn: 361740
* [X86] Add zero idioms to the haswell, broadwell, and skylake schedule ↵Craig Topper2019-05-255-1405/+1405
| | | | | | | | | | models. Add 256-bit fp xor to sandybridge zero idioms This copies the Sandy Bridge zero idiom support to later CPUs. Adding the AVX2 and AVX512F/VL instructions as appropriate. Differential Revision: https://reviews.llvm.org/D62360 llvm-svn: 361690
* [X86][llvm-mca] Add zero idiom tests for Intel CPUs. NFCCraig Topper2019-05-255-44/+2296
| | | | | | This pre-commits tests for D62360 llvm-svn: 361689
* [dwarfdump] Add flag to limit the number of parents DIEsJonas Devlieghere2019-05-242-0/+6
| | | | | | | | | This adds `-parent-recurse-depth` which limits the number of parent DIEs being dumped. Differential revision: https://reviews.llvm.org/D62359 llvm-svn: 361671
* [llvm-objcopy] - Strip undefined symbols if they are no longer referenced ↵George Rimar2019-05-241-0/+60
| | | | | | | | | | | | | following --only-section This is https://bugs.llvm.org/show_bug.cgi?id=40004. In this patch I teach llvm-objcopy to remove undefined symbols if them are not used anymore after applying -j/--only-section option. Differential revision: https://reviews.llvm.org/D62317 llvm-svn: 361642
* [llvm-readobj] Implement GNU-style output for dynamic tableSimon Atanasyan2019-05-248-166/+251
| | | | | | | | | | | | | | | | | | | | | | | | | | | GNU readelf tool prints slightly different dynamic table "header" and surrounds dynamic tag names by brackets. This patch implements the same formatting for GNU-style output of the `llvm-readobj`. LLVM ``` DynamicSection [ (13 entries) Tag Type Name/Value 0x00000006 SYMTAB 0x168 ... ] ``` GNU ``` Dynamic section at offset 0x1d0 contains 13 entries: Tag Type Name/Value 0x00000006 (SYMTAB) 0x168 ... ``` Differential Revision: https://reviews.llvm.org/D62256 llvm-svn: 361633
* Revert r361630 "[llvm-readelf] - Allow dumping of the .dynamic section even ↵George Rimar2019-05-241-11/+4
| | | | | | | | | if there is no PT_DYNAMIC header." It broke BB: http://lab.llvm.org:8011/builders/ppc64le-lld-multistage-test/builds/3748 llvm-svn: 361631
* [llvm-readelf] - Allow dumping of the .dynamic section even if there is no ↵George Rimar2019-05-241-4/+11
| | | | | | | | | | | | | PT_DYNAMIC header. It is now possible after D61937 was landed and was discussed in it's review comments. It is not consistent with GNU, which does not output .dynamic section content in this case for no visible reason. Differential revision: https://reviews.llvm.org/D62179 llvm-svn: 361630
* [llvm-readobj][mips] Align GOT columns headers properly in 64-bit caseSimon Atanasyan2019-05-241-5/+5
| | | | llvm-svn: 361626
* [llvm-objdump][test] Fix for spurious matches against file pathsJames Henderson2019-05-243-10/+10
| | | | | | | | | r361479 added tests that did --implicit-check-not=main, but a user found that they failed on his machine, due to it having 'main' in a file path printed earlier in the output. This test fixes this issue by making the check pattern more explicit. llvm-svn: 361621
* [llvm-nm] Fix Bug 41353 - unique symbols printed as D instead of uJordan Rupprecht2019-05-241-0/+50
| | | | | | | | | | | | | | | | | | | | | Summary: https://bugs.llvm.org/show_bug.cgi?id=41353 I'm new to LLVM and C++ so please do not hesitate to iterate with me on this fix. Patch by Mike Pozulp! Reviewers: rupprecht, zbrid, grimar, jhenderson Reviewed By: rupprecht, jhenderson Subscribers: jhenderson, chrisjackson, MaskRay, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61117 llvm-svn: 361595
* fix accidental implicit matches in elf-disassemble-symbol-labels-rel.testBob Haarman2019-05-231-0/+1
| | | | | | | | | | | | llvm/test/tools/llvm-objdump/X86/elf-disassemble-symbol-labels-rel.test uses --implicit-check-not to verify that certain patterns do not occur in llvm-objdump's output, except in places where they are explicitly checked. Unfortunately, the patterns are generic enough that they may be part of the file name which is also output by llvm-objdump. This change matches the line with the filename explicitly so that the implicit patterns are not applied to it. llvm-svn: 361563
* [llvm-objdump][test] Make MachO test names consistentFangrui Song2019-05-233-0/+0
| | | | | | | We have macho-disassembl{e,y}-*. Rename macho-disassembly-* to macho-disassemble-* for consistency. llvm-svn: 361492
* [llvm-objdump][test] Make test names consistentJames Henderson2019-05-235-0/+0
| | | | | | | | This change renames a number of the disassembly tests to standardise disasm/diassemble/disassembly to disassemble. Requested in https://reviews.llvm.org/D62255. llvm-svn: 361491
* [llvm-objdump][test] Improve testing of some switches #3James Henderson2019-05-2314-34/+604
| | | | | | | | | | | | This is the third commit in a series of patches to improve test coverage of llvm-objdump. In this patch I have added a number of tests testing various aspects of disassembly. Reviewed by: MaskRay, grimar, rupprecht Differential Revision: https://reviews.llvm.org/D62255 llvm-svn: 361489
* [llvm-objdump][test] Improve testing of some switches #2James Henderson2019-05-236-16/+100
| | | | | | | | | | | | | This patch focuses on adding additional testing for the --source switch. For reference, the source-interleave-x86_64.ll test file has been split into two parts - the input (shared with the other tests) and the test itself. Reviewed by: MaskRay, rupprecht, grimar Differential Revision: https://reviews.llvm.org/D61996 llvm-svn: 361479
* [llvm-objcopy] Add file names to error messagesSeiya Nuta2019-05-2310-24/+28
| | | | | | | | | | | | | | | | | | | Summary: This patch adds the file names to llvm-objcopy error messages. It makes easy to identify which file causes an error. Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=41798 Reviewers: espindola, alexshap, rupprecht, jhenderson, jakehehrlich Reviewed By: rupprecht, jhenderson, jakehehrlich Subscribers: emaste, arichardson, jakehehrlich, MaskRay, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61993 llvm-svn: 361450
* [llvm-objdump] Dump inline relocations if the relocated section is specified ↵Fangrui Song2019-05-221-11/+2
| | | | | | | | | | | | | | with --section This fixes PR41886: llvm-objdump -d -r -j .text doesn't show inline relocations of .text While here, switch to stable_sort() because we don't want to change the order of relocations applied to the same location. gABI says consecutive relocation records are composed together and their order matters. In practise it is difficult to see relocations applied to the same location not consecutive, we just have to keep the relative order of relocations with the same offset. Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D62253 llvm-svn: 361395
* [llvm-objcopy] Tidy up error messagesJames Henderson2019-05-2221-21/+21
| | | | | | | | | | | | | | This patch brings various error messages into line with each other, by removing trailing full stops, and making the first letter lower-case. This addresses https://bugs.llvm.org/show_bug.cgi?id=40859. Reviewed by: jhenderson, rupprecht, jakehehrlich Differential Revision: https://reviews.llvm.org/D62072 Patch by Alex Brachet llvm-svn: 361384
* [llvm-dlltool] Respect NONAME keywordMartin Storsjo2019-05-221-0/+14
| | | | | | | | | | | This adds proper handling of the NONAME-keyword, which makes llvm-dlltool generate an import using the ordinal instead of the name. Patch by by Jannik Vogel, test added by Stefan Schmidt. Differential Revision: https://reviews.llvm.org/D62175 llvm-svn: 361367
* [NFC] Remove a blank line (test commit)Seiya Nuta2019-05-221-1/+0
| | | | llvm-svn: 361349
* [llvm-objdump] Make --disassemble-functions imply -dGeorge Rimar2019-05-211-0/+22
| | | | | | | | | | Fixes https://bugs.llvm.org/show_bug.cgi?id=41903 Patch by Mike Pozulp! Differential revision: https://reviews.llvm.org/D62054 llvm-svn: 361240
* [llvm-objcopy] Strip file symbols with --strip-unneededEugene Leviant2019-05-211-10/+8
| | | | | | Differential revision: https://reviews.llvm.org/D61641 llvm-svn: 361231
* [llvm-readelf] - Rework how we parse the .dynamic section.George Rimar2019-05-203-3/+141
| | | | | | | | | | | | | This is a result of what I found during my work on https://bugs.llvm.org/show_bug.cgi?id=41679. Previously LLVM readelf took the information about .dynamic section from its PT_DYNAMIC segment only. GNU tools have a bit different logic. They also use the information from the .dynamic section header if it is available. This patch changes the code to improve the compatibility with the GNU Binutils. Differential revision: https://reviews.llvm.org/D61937 llvm-svn: 361165
* [llvm-objdump]Move test code missed in r360904James Henderson2019-05-162-24/+24
| | | | llvm-svn: 360909
* Minidump: Add support for the MemoryList streamPavel Labath2019-05-161-8/+16
| | | | | | | | | | | | | | | | | | Summary: the stream format is exactly the same as for ThreadList and ModuleList streams, only the entry types are slightly different, so the changes in this patch are just straight-forward applications of established patterns. Reviewers: amccarth, jhenderson, clayborg Subscribers: markmentovai, lldb-commits, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61885 llvm-svn: 360908
* [llvm-objdump]Split section-filter.test in two to remove X86 dependencyJames Henderson2019-05-162-87/+85
| | | | | | | This allows the generic parts of section-filter.test to be tested on all targets. The X86-specific parts have been moved to another test. llvm-svn: 360904
* [llvm-objdump] Add "REQUIES: x86-registered-target" to section-filter.test ↵Fangrui Song2019-05-161-0/+1
| | | | | | | | | after rL360893 Appease the hexagon buildbot that doesn't build X86. Disassemblers require Target/X86 support. llvm-svn: 360901
* [llvm-objdump]Improve testing of some switches #1James Henderson2019-05-164-34/+255
| | | | | | | | | | | | | This is the first in a set of patches I have to improve testing of llvm-objdump. This patch targets --all-headers, --section, and --full-contents. In the --section case, it deletes a pre-canned binary which is only used by the one test and replaces it with yaml. Reviewed by: grimar, MaskRay Differential Revision: https://reviews.llvm.org/D61941 llvm-svn: 360893
* [lit][tests]Add feature libcxx-used and use it in llvm-*-fuzzer testsXing Xue2019-05-143-0/+9
| | | | | | | | | | | | | | | | When a LLVM binary such as llvm-*-fuzzer is built with libc++, it has dependency on libc++. The path to find shared libraries specified in llvm-*-fuzzer is relative. As a result, these binaries cannot be copied to an arbitrary directory and launched from there. Changes in this patch add a LIT feature to indicate that libc++ is used to build and, based on the feature exclude test cases that test by copying llvm-*-fuzzer binaries to a directory. Reviewers: hubert.reinterpretcast, dberris, amyk, jasonliu, EricWF Reviewed By: hubert.reinterpretcast, amyk Subscribers: javed.absar, jsji, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61265 llvm-svn: 360672
* AArch64: support binutils-like things on arm64_32.Tim Northover2019-05-145-0/+34
| | | | | | | | This adds support for the arm64_32 watchOS ABI to LLVM's low level tools, teaching them about the specific MachO choices and constants needed to disassemble things. llvm-svn: 360663
* [test]Make test work on WindowsJames Henderson2019-05-141-2/+1
| | | | | | | | | | | | | Previously, the test didn't work because '\' characters appeared in the sed string, causing bogus escape characters to form in the substituted string literal. Switching to using '%/p' causes the path to be emitted with '/' characters instead, so that there are are no escaping issues. Reviewed by: kzhuravl, grimar Differential Revision: https://reviews.llvm.org/D61856 llvm-svn: 360660
* [COFF] Fix .bss section size bug in obj2yaml / yaml2objReid Kleckner2019-05-101-0/+14
| | | | | | | | | We need to serialize SizeOfRawData through even when there is no data, as in a .bss section. Fixes PR41836 llvm-svn: 360473
OpenPOWER on IntegriCloud