summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* [llvm-readelf] - Report a warning when .hash section contains a chain with a ↵George Rimar2019-10-021-0/+40
| | | | | | | | | | | | cycle. It is possible to craft a .hash section that triggers an infinite loop in llvm-readelf code. This patch fixes the issue and introduces a warning. Differential revision: https://reviews.llvm.org/D68086 llvm-svn: 373476
* [yaml2obj] - Alow Size tag for describing SHT_HASH sections.George Rimar2019-10-021-3/+102
| | | | | | | | | This is a follow-up for D68085 which allows using "Size" tag together with "Content" tag or alone. Differential revision: https://reviews.llvm.org/D68216 llvm-svn: 373473
* [llvm-dwarfdump] Fix dumping of wrong locstats mapDjordje Todorovic2019-10-021-3/+3
| | | | llvm-svn: 373469
* [llvm-objcopy] Add --set-section-alignmentFangrui Song2019-10-022-0/+62
| | | | | | | | | | | | | Fixes PR43181. This option was recently added to GNU objcopy (binutils PR24942). `llvm-objcopy -I binary -O elf64-x86-64 --set-section-alignment .data=8` can set the alignment of .data. Reviewed By: grimar, jhenderson, rupprecht Differential Revision: https://reviews.llvm.org/D67656 llvm-svn: 373461
* Reland "[utils] Implement the llvm-locstats tool"Djordje Todorovic2019-10-022-0/+177
| | | | | | | | | | | | | | | | | | The tool reports verbose output for the DWARF debug location coverage. The llvm-locstats for each variable or formal parameter DIE computes what percentage from the code section bytes, where it is in scope, it has location description. The line 0 shows the number (and the percentage) of DIEs with no location information, but the line 100 shows the number (and the percentage) of DIEs where there is location information in all code section bytes (where the variable or parameter is in the scope). The line 50..59 shows the number (and the percentage) of DIEs where the location information is in between 50 and 59 percentage of its scope covered. Differential Revision: https://reviews.llvm.org/D66526 The cause of the test failure was resolved. llvm-svn: 373427
* [llvm-lib] Detect duplicate input filesRui Ueyama2019-10-021-0/+14
| | | | | | Differential Revision: https://reviews.llvm.org/D68320 llvm-svn: 373426
* [llvm-lib] Correctly handle .lib input filesRui Ueyama2019-10-022-1/+16
| | | | | | | | | | | | | | | | If archive files are passed as input files, llvm-lib needs to append the members of the input archive files to the output file. This patch implements that behavior. This patch splits an existing function into smaller functions. Effectively, the new code is only `if (Magic == file_magic::archive) { ... }` part. Fixes https://bugs.llvm.org/show_bug.cgi?id=32674 Differential Revision: https://reviews.llvm.org/D68204 llvm-svn: 373424
* [llvm-mca] Add a -mattr flagDavid Green2019-10-011-0/+29
| | | | | | | | | This adds a -mattr flag to llvm-mca, for cases where the -mcpu option does not contain all optional features. Differential Revision: https://reviews.llvm.org/D68190 llvm-svn: 373358
* Revert "Reland "[utils] Implement the llvm-locstats tool""Djordje Todorovic2019-10-012-177/+0
| | | | | | | This reverts commit rL373317 due to test failure on the clang-s390x-linux build bot. llvm-svn: 373336
* Reland "[utils] Implement the llvm-locstats tool"Djordje Todorovic2019-10-012-0/+177
| | | | | | | | | | | | | | | | The tool reports verbose output for the DWARF debug location coverage. The llvm-locstats for each variable or formal parameter DIE computes what percentage from the code section bytes, where it is in scope, it has location description. The line 0 shows the number (and the percentage) of DIEs with no location information, but the line 100 shows the number (and the percentage) of DIEs where there is location information in all code section bytes (where the variable or parameter is in the scope). The line 50..59 shows the number (and the percentage) of DIEs where the location information is in between 50 and 59 percentage of its scope covered. Differential Revision: https://reviews.llvm.org/D66526 llvm-svn: 373317
* [yaml2obj] - Allow specifying custom Link values for SHT_HASH section.George Rimar2019-10-011-0/+32
| | | | | | | | This allows setting any sh_link values for SHT_HASH sections. Differential revision: https://reviews.llvm.org/D68214 llvm-svn: 373316
* [yaml2obj/obj2yaml] - Add support for SHT_HASH sections.George Rimar2019-10-014-0/+227
| | | | | | | | | | | | | | | SHT_HASH specification is: http://www.sco.com/developers/gabi/latest/ch5.dynamic.html#hash In short the format is the following: it has 2 uint32 fields in its header: nbucket and nchain followed by (nbucket + nchain) uint32 values. This patch allows dumping and parsing such sections. Differential revision: https://reviews.llvm.org/D68085 llvm-svn: 373315
* Fixup r373278: Move test to X86 directoryDiana Picus2019-10-011-0/+0
| | | | | | ...since it's using an x86 triple. llvm-svn: 373314
* [llvm-readobj/llvm-readelf] Delete --arm-attributes (alias for --arch-specific)Fangrui Song2019-10-012-4/+0
| | | | | | | | | | | | | | | | D68110 added --arch-specific (supported by GNU readelf) and made --arm-attributes an alias for it. The tests were later migrated to use --arch-specific. Note, llvm-readelf --arch-specific currently just uses llvm-readobj style output for ARM attributes. The readelf-style output is not implemented. Reviewed By: compnerd, kongyi, rupprecht Differential Revision: https://reviews.llvm.org/D68196 llvm-svn: 373291
* DebugInfo: Add parsing support for debug_loc base address specifiersDavid Blaikie2019-10-011-0/+34
| | | | llvm-svn: 373278
* Revert "Reland "[utils] Implement the llvm-locstats tool""Djordje Todorovic2019-09-302-176/+0
| | | | | | This reverts commit rL373183. llvm-svn: 373200
* [llvm-locstats] Fix the test for the Hexagon targetDjordje Todorovic2019-09-301-0/+1
| | | | llvm-svn: 373189
* Reland "[utils] Implement the llvm-locstats tool"Djordje Todorovic2019-09-302-0/+175
| | | | | | | | | | | | | | | | The tool reports verbose output for the DWARF debug location coverage. The llvm-locstats for each variable or formal parameter DIE computes what percentage from the code section bytes, where it is in scope, it has location description. The line 0 shows the number (and the percentage) of DIEs with no location information, but the line 100 shows the number (and the percentage) of DIEs where there is location information in all code section bytes (where the variable or parameter is in the scope). The line 50..59 shows the number (and the percentage) of DIEs where the location information is in between 50 and 59 percentage of its scope covered. Differential Revision: https://reviews.llvm.org/D66526 llvm-svn: 373183
* [llvm-lipo] Add support for -arch Alexander Shaposhnikov2019-09-272-5/+22
| | | | | | | | | | Add support for -arch. Differential revision: https://reviews.llvm.org/D68116 Test plan: make check-all llvm-svn: 373132
* [llvm-readobj] Rename --arm-attributes to --arch-specificYi Kong2019-09-2723-21/+29
| | | | | | | | | This is for compatibility with GNU readobj. --arm-attributes option is left as a hidden alias due to large number of tests using it. Differential Revision: https://reviews.llvm.org/D68110 llvm-svn: 373125
* [llvm-exegesis] Add loop mode for repeating the snippet.Clement Courbet2019-09-2713-13/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Before this change the Executable function was made by duplicating the snippet. This change adds a --repetion-mode={loop|duplicate} flag that allows choosing between this behaviour and wrapping the snippet instructions in a loop. The new mode can help measurements when the snippet fits in the DSB by short-cirtcuiting decoding. The loop adds a dec + jmp to the measurements, but since these are not part of the critical path, they execute in parallel with the measured code and do not impact measurements in practice. Overview of the change: - New SnippetRepetitor abstraction that handles repeating the snippet. The assembler delegates repeating the instructions to this class. - ExegesisTarget learns how to decrement loop counter and jump. - Some refactoring of the assembler into FunctionFiller/BasicBlockFiller. Reviewers: gchatelet Subscribers: mgorny, tschuett, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68125 llvm-svn: 373083
* [llvm-ar][test] Move MRI tests from "llvm/test/Object/"Owen Reynolds2019-09-267-0/+28
| | | | | | | | | | 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
* [llvm-readobj/llvm-readelf] - .stack_sizes: demangle symbol names in ↵George Rimar2019-09-251-12/+20
| | | | | | | | | | | | | | | warnings reported. I started this patch as a refactoring, tried to make a helper for getting symbol names, similar to how we get section names used in warning messages. So this patch cleanups the code and fixes an issue: symbol names in warning messages were not demangled. Differential revision: https://reviews.llvm.org/D68012 llvm-svn: 372867
* [llvm-readobj] - Simplify stack-sizes.test test case.George Rimar2019-09-251-10/+20
| | | | | | | | | | This is a follow-up for D67757, which allows to describe .stack_sizes sections with a new YAML syntax. Differential revision: https://reviews.llvm.org/D67759 llvm-svn: 372855
* [yaml2elf] - Support describing .stack_sizes sections using unique suffixes.George Rimar2019-09-251-0/+31
| | | | | | | | | | | | | Currently we can't use unique suffixes in section names to describe stack sizes sections. E.g. '.stack_sizes [1]' will be treated as a regular section. This happens because we recognize stack sizes section by name and do not yet drop the suffix before the check. The patch fixes it. Differential revision: https://reviews.llvm.org/D68018 llvm-svn: 372853
* [yaml2obj] - Add a Size field for StackSizesSection.George Rimar2019-09-251-2/+86
| | | | | | | | | | It is a follow-up requested in the review comment for D67757. Allows to use Content + Size or just Size when describing .stack_sizes sections in YAML document Differential revision: https://reviews.llvm.org/D67958 llvm-svn: 372845
* [llvm-readobj] - Don't crash when dumping .stack_sizes and unable to find a ↵George Rimar2019-09-251-0/+26
| | | | | | | | | | | | | | | relocation resolver. The crash might happen when we have either a broken or unsupported object and trying to resolve relocations when dumping the .stack_sizes section. For the test case I used a 32-bits ELF header and a 64-bit relocation. In this case a null pointer is returned by the code instead of the relocation resolver function and then we crash. Differential revision: https://reviews.llvm.org/D67962 llvm-svn: 372838
* [llvm-objcopy][test] Clean up -B testsFangrui Song2019-09-253-30/+13
| | | | | | | | | | | | | -B is ignored for GNU objcopy compatibility after D67215/r371914. * Delete mentions of -B from input-output-target.test - we have enough -B tests. * Merge binary-input-with-arch.test into binary-output-target.test. Reviewed By: rupprecht Differential Revision: https://reviews.llvm.org/D67693 llvm-svn: 372809
* [yaml2obj/obj2yaml] - Add support for .stack_sizes sections.George Rimar2019-09-243-3/+321
| | | | | | | | | | | .stack_sizes is a SHT_PROGBITS section that contains pairs of <address (4/8 bytes), stack size (uleb128)>. This patch teach tools to parse and dump it. Differential revision: https://reviews.llvm.org/D67757 llvm-svn: 372762
* [llvm-lipo] Add support for archives Alexander Shaposhnikov2019-09-231-0/+26
| | | | | | | | | | | Add support for creating universal binaries which can contain an archive. Differential revision: https://reviews.llvm.org/D67758 Test plan: make check-all llvm-svn: 372666
* Revert "Reland "[utils] Implement the llvm-locstats tool""Djordje Todorovic2019-09-231-17/+0
| | | | | | This reverts commit rL372554. llvm-svn: 372580
* [llvm-readobj] - Stop treating ".stack_sizes.*" sections as stack sizes ↵George Rimar2019-09-231-3/+3
| | | | | | | | | | | | | | | | sections. llvm-readobj currently handles .stack_sizes.* (e.g. .stack_sizes.foo) as a normal stack sizes section. Though MC does not produce sections with such names. Also, linkers do not combine .stack_sizes.* into .stack_sizes. A mini discussion about this correctness issue is here: https://reviews.llvm.org/D67757#inline-609274 This patch changes implementation so that only now only '.stack_sizes' name is accepted as a real stack sizes section. Differential revision: https://reviews.llvm.org/D67824 llvm-svn: 372578
* [llvm-readobj] - Implement LLVM-style dumping for .stack_sizes sections.George Rimar2019-09-233-68/+195
| | | | | | | | | D65313 implemented GNU-style dumping (llvm-readelf). This one implements LLVM-style dumping (llvm-readobj). Differential revision: https://reviews.llvm.org/D67834 llvm-svn: 372576
* Reland "[utils] Implement the llvm-locstats tool"Djordje Todorovic2019-09-231-0/+17
| | | | | | | | | | | | | | | | The tool reports verbose output for the DWARF debug location coverage. The llvm-locstats for each variable or formal parameter DIE computes what percentage from the code section bytes, where it is in scope, it has location description. The line 0 shows the number (and the percentage) of DIEs with no location information, but the line 100 shows the number (and the percentage) of DIEs where there is location information in all code section bytes (where the variable or parameter is in the scope). The line 50..59 shows the number (and the percentage) of DIEs where the location information is in between 50 and 59 percentage of its scope covered. Differential Revision: https://reviews.llvm.org/D66526 llvm-svn: 372554
* Recommit [SampleFDO] Expose an interface to return the size of a sectionWei Mi2019-09-211-0/+7
| | | | | | | | | | | | | | | | | | | | | or the size of the profile for profile in ExtBinary format. Fix a test failure on Mac. [SampleFDO] Expose an interface to return the size of a section or the size of the profile for profile in ExtBinary format. Sometimes we want to limit the size of the profile by stripping some functions with low sample count or by stripping some function names with small text size from profile symbol list. That requires the profile reader to have the interfaces returning the size of a section or the size of total profile. The patch add those interfaces. At the same time, add some dump facility to show the size of each section. Differential revision: https://reviews.llvm.org/D67726 llvm-svn: 372478
* Revert "[SampleFDO] Expose an interface to return the size of a section or ↵Amara Emerson2019-09-211-7/+0
| | | | | | | | | | the size" This reverts commit f118852046a1d255ed8c65c6b5db320e8cea53a0. Broke the macOS build/greendragon bots. llvm-svn: 372464
* [SampleFDO] Expose an interface to return the size of a section or the sizeWei Mi2019-09-201-0/+7
| | | | | | | | | | | | | | of the profile for profile in ExtBinary format. Sometimes we want to limit the size of the profile by stripping some functions with low sample count or by stripping some function names with small text size from profile symbol list. That requires the profile reader to have the interfaces returning the size of a section or the size of total profile. The patch add those interfaces. At the same time, add some dump facility to show the size of each section. llvm-svn: 372439
* [yaml2obj/obj2yaml] - Do not trigger llvm_unreachable when dumping/parsing ↵George Rimar2019-09-202-0/+62
| | | | | | | | | | | | | | relocations and e_machine is unsupported. Currently when e_machine is set to something that is not supported by YAML lib, then tools fail with llvm_unreachable. In this patch I allow them to handle relocations in this case. It can be used to dump and create objects for broken or unsupported targets. Differential revision: https://reviews.llvm.org/D67657 llvm-svn: 372377
* Reapply [llvm-ar] Include a line number when failing to parse an MRI scriptOwen Reynolds2019-09-202-2/+43
| | | | | | | | | | | 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] Removes repetition in the error messageFangrui Song2019-09-201-0/+8
| | | | | | | | | As per bug 40244, fixed an error where the error message was repeated. Differential Revision: https://reviews.llvm.org/D67038 Patch by Yu Jian (wyjw) llvm-svn: 372370
* [MCA] Improved cost computation for loop carried dependencies in the ↵Andrea Di Biagio2019-09-191-8/+4
| | | | | | | | | | | | | | | | bottleneck analysis. This patch introduces a cut-off threshold for dependency edge frequences with the goal of simplifying the critical sequence computation. This patch also removes the cost normalization for loop carried dependencies. We didn't really need to artificially amplify the cost of loop-carried dependencies since it is already computed as the integral over time of the delay (in cycle). In the absence of backend stalls there is no need for computing a critical sequence. With this patch we early exit from the critical sequence computation if no bottleneck was reported during the simulation. llvm-svn: 372337
* Revert [llvm-ar] Include a line number when failing to parse an MRI scriptOwen Reynolds2019-09-192-43/+2
| | | | | | | | Revert r372309 due to buildbot failures Differential Revision: https://reviews.llvm.org/D67449 llvm-svn: 372311
* [llvm-ar] Include a line number when failing to parse an MRI scriptOwen Reynolds2019-09-192-2/+43
| | | | | | | | | Errors that occur when reading an MRI script now include a corresponding line number. Differential Revision: https://reviews.llvm.org/D67449 llvm-svn: 372309
* [llvm-readobj/llvm-objdump] - Improve how tool locate the dynamic table and ↵George Rimar2019-09-173-44/+215
| | | | | | | | | | | | | | | | | | | | | report warnings about that. Before this patch we gave a priority to a dynamic table found from the section header. It was discussed (here: https://reviews.llvm.org/D67078?id=218356#inline-602082) that probably preferring the table from PT_DYNAMIC is better, because it is what runtime loader sees. This patch makes the table from PT_DYNAMIC be chosen at first place if it is available. But also it adds logic to fall back to SHT_DYNAMIC if the table from the dynamic segment is broken or fall back to use no table if both are broken. It adds a few more diagnostic warnings for the logic above. Differential revision: https://reviews.llvm.org/D67547 llvm-svn: 372122
* [llvm-readobj] - Test PPC64 relocations properly.George Rimar2019-09-172-3/+258
| | | | | | | | | We had a precompiled binary committed and not all of the relocations supported were tested. This patch fixes this. Differential revision: https://reviews.llvm.org/D67617 llvm-svn: 372110
* [obj2yaml] - Support PPC64 relocation types.George Rimar2019-09-171-0/+488
| | | | | | | | | | | | | We do not support them and fail with llvm_unreachable currently. This is not the only target we do not support and also seems we are missing the tests for those we have already. But I needed this one for another patch, so posted it separatelly. Relocation names are taken from llvm\include\llvm\BinaryFormat\ELFRelocs\PowerPC64.def Differential revision: https://reviews.llvm.org/D67615 llvm-svn: 372109
* [yaml2obj/obj2yaml] - Allow setting an arbitrary values for e_machine.George Rimar2019-09-172-0/+94
| | | | | | | | | | | | | | | Currently we only allow using a known named constants for `Machine` field in YAML documents. This patch allows using any numbers (valid or "unknown") and adds test cases for current and new functionality. With this it is possible to write a test cases for really unknown EM_* targets. Differential revision: https://reviews.llvm.org/D67652 llvm-svn: 372108
* [llvm-readobj] - Fix BB after r372087.George Rimar2019-09-171-1/+1
| | | | | | Seems I forgot to update the number of bytes checked. llvm-svn: 372089
* [llvm-ar] Parse 'h' and '-h': display help and exitFangrui Song2019-09-171-0/+6
| | | | | | | | | | | Support `llvm-ar h` and `llvm-ar -h` because they may be what users try at first. Note, operation 'h' is undocumented in GNU ar. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D67560 llvm-svn: 372088
* [llvm-readobj] - Fix a TODO in elf-reloc-zero-name-or-value.test.George Rimar2019-09-171-6/+20
| | | | | | | | | | | | | The "TODO" mentioned was: "Add test for symbol with no name but with a value once yaml2obj allows referencing symbols with no name from relocations." We can do it now. Differential revision: https://reviews.llvm.org/D67609 llvm-svn: 372087
OpenPOWER on IntegriCloud