summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "Add --strip-trailing-cr to compression tests so they pass on Windows."Xiangling Liao2019-12-042-2/+2
| | | | | | This reverts commit d6cbc9528d46d30416a6f9cd6c8570b704a0bd33. It causes the tests to fail on AIX.
* Add --strip-trailing-cr to compression tests so they pass on Windows.Amy Huang2019-12-042-2/+2
|
* Revert "[Coverage] Revise format to reduce binary size"Vedant Kumar2019-12-042-1/+0
| | | | | | | | | | This reverts commit e18531595bba495946aa52c0a16b9f9238cff8bc. On Windows, there is an error: http://lab.llvm.org:8011/builders/sanitizer-windows/builds/54963/steps/stage%201%20check/logs/stdio error: C:\b\slave\sanitizer-windows\build\stage1\projects\compiler-rt\test\profile\Profile-x86_64\Output\instrprof-merging.cpp.tmp.v1.o: Failed to load coverage: Malformed coverage data
* [Coverage] Revise format to reduce binary sizeVedant Kumar2019-12-042-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revise the coverage mapping format to reduce binary size by: 1. Naming function records and marking them `linkonce_odr`, and 2. Compressing filenames. This shrinks the size of llc's coverage segment by 82% (334MB -> 62MB) and speeds up end-to-end single-threaded report generation by 10%. For reference the compressed name data in llc is 81MB (__llvm_prf_names). Rationale for changes to the format: - With the current format, most coverage function records are discarded. E.g., more than 97% of the records in llc are *duplicate* placeholders for functions visible-but-not-used in TUs. Placeholders *are* used to show under-covered functions, but duplicate placeholders waste space. - We reached general consensus about giving (1) a try at the 2017 code coverage BoF [1]. The thinking was that using `linkonce_odr` to merge duplicates is simpler than alternatives like teaching build systems about a coverage-aware database/module/etc on the side. - Revising the format is expensive due to the backwards compatibility requirement, so we might as well compress filenames while we're at it. This shrinks the encoded filenames in llc by 86% (12MB -> 1.6MB). See CoverageMappingFormat.rst for the details on what exactly has changed. Fixes PR34533 [2], hopefully. [1] http://lists.llvm.org/pipermail/llvm-dev/2017-October/118428.html [2] https://bugs.llvm.org/show_bug.cgi?id=34533 Differential Revision: https://reviews.llvm.org/D69471
* [Gold Tests] Add missing target flag to X86 testTroy Johnson2019-12-041-0/+2
| | | | | | | This test was failing on non-X86 targets because the gold invocation did not have the necessary -m flag. Differential Revision: https://reviews.llvm.org/D70982
* [llvm-ar][test] Add to thin archive test coveragegbreynoo2019-12-046-82/+136
| | | | | | | | This diff adds test coverage for thin archives including additions to existing tests. In some cases I have updated the formats of these tests to better match other tests in the archive. Differential Revision: https://reviews.llvm.org/D70969
* [ELF] Support for PT_GNU_PROPERTY in header and toolsPeter Smith2019-12-043-0/+35
| | | | | | | | | | | | | The PT_GNU_PROPERTY is generated by a linker to describe the .note.gnu.property section. The Linux kernel uses this program header to locate the .note.gnu.property section. It is described in "The Linux gABI extension" Include support for llvm-readelf, llvm-readobj and the yaml reader and writers. Differential Revision: https://reviews.llvm.org/D70959
* [yaml2obj] - Make DynamicSymbols to be Optional<> too.Georgii Rymar2019-12-046-35/+83
| | | | | | | | | | | | | | | | | | We already have Symbols property to list regular symbols and it is currently Optional<>. This patch makes DynamicSymbols to be optional too. With this there is no need to define a dummy symbol anymore to trigger creation of the .dynsym and it is now possible to define an empty .dynsym using just the following line: DynamicSymbols: [] (it is important to have when you do not want to have dynamic symbols, but want to have a .dynsym) Now the code is consistent and it helped to fix a bug: previously we did not report an error when both Content/Size and an empty Symbols/DynamicSymbols list were specified. Differential revision: https://reviews.llvm.org/D70956
* [DWARFDebugLoclists] Add support for other DW_LLE encodingsPavel Labath2019-12-041-24/+89
| | | | | | | | | | | | | | | Summary: lldb's loclists parser has support for DW_LLE_start_end(x) encodings. To avoid regressing when switching the implementation to llvm's, I add parsing support for all previously unsupported location list encodings. Reviewers: dblaikie, JDevlieghere, aprantl, SouraVX Subscribers: hiraditya, probinson, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70949
* [yaml2obj][test] - Remove excessive symtab-shinfo.yaml.Georgii Rymar2019-12-041-43/+0
| | | | | | | The same testing is performed in `implicit-sections-info.yaml`: https://github.com/llvm-mirror/llvm/blob/master/test/tools/yaml2obj/implicit-sections-info.yaml Differential revision: https://reviews.llvm.org/D70957
* [llvm-strip][MachO] Test llvm-strip --strip-debugFangrui Song2019-12-031-0/+3
| | | | | | Reviewed By: smeenai Differential Revision: https://reviews.llvm.org/D70995
* [Object/ELF] - Refine the error reported when section's offset + size ↵Georgii Rymar2019-12-032-2/+2
| | | | | | | | | | | | | | | 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
* [DWARF] Add support for parsing/dumping section indices in location listsPavel Labath2019-12-031-7/+38
| | | | | | | | | | | | | | | | | | | Summary: This does exactly what it says on the box. The only small gotcha is the section index computation for offset_pair entries, which can use either the base address section, or the section from the offset_pair entry. This is to support both the cases where the base address is relocated (points to the base of the CU, typically), and the case where the base address is a constant (typically zero) and relocations are on the offsets themselves. Reviewers: dblaikie, JDevlieghere, aprantl, SouraVX Subscribers: hiraditya, llvm-commits, probinson Tags: #llvm Differential Revision: https://reviews.llvm.org/D70540
* [X86] Model MXCSR for AVX instructions other than AVX512Wang, Pengfei2019-12-031-2/+1
| | | | | | | | | | | | Summary: Model MXCSR for AVX instructions other than AVX512 Reviewers: craig.topper, RKSimon Subscribers: hiraditya, llvm-commits, LuoYuanke, LiuChen3 Tags: #llvm Differential Revision: https://reviews.llvm.org/D70875
* [llvm-exegesis] Fix 44b9942898c7.Clement Courbet2019-12-021-0/+13
| | | | | | | | | | | | | | Summary: Add missing stack release instructions in loadImplicitRegAndFinalize. Reviewers: pengfei, gchatelet Subscribers: tschuett, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70903
* [X86] Add initialization of FPCW in llvm-exegesisWang, Pengfei2019-12-021-0/+9
| | | | | | | | | | | | Summary: This is a following up to D70874. It adds the initialization of FPCW in llvm-exegesis. Reviewers: craig.topper, RKSimon, courbet, gchatelet Subscribers: tschuett, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70891
* [llvm-readobj/llvm-readelf] - Simplify the code that dumps versions.Georgii Rymar2019-12-022-22/+121
| | | | | | | | | | | | After changes introduced in D70495 and D70826 its now possible to significantly simplify the code we have. This also fixes an issue: previous code assumed that version strings should always be read from the dynamic string table. While it is normally true, the string table should be taken from the corresponding sh_link field. Differential revision: https://reviews.llvm.org/D70855
* [X86] Add initialization of MXCSR in llvm-exegesisWang, Pengfei2019-12-021-0/+3
| | | | | | | | | | | | Summary: This patch is used to initialize the new added register MXCSR. Reviewers: craig.topper, RKSimon Subscribers: tschuett, courbet, llvm-commits, LiuChen3 Tags: #llvm Differential Revision: https://reviews.llvm.org/D70874
* [llvm-readelf/llvm-readobj] - Check the version of SHT_GNU_verneed section ↵Georgii Rymar2019-12-021-0/+31
| | | | | | | | | | | | | | | entries. It is a follow-up for D70826 and it is similar to D70810. SHT_GNU_verneed contains the following fields: `vn_version`: Version of structure. This value is currently set to 1, and will be reset if the versioning implementation is incompatibly altered. (https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/symversion.html) We should check it for correctness. Differential revision: https://reviews.llvm.org/D70842
* [llvm-readobj/llvm-readelf] - Reimplement dumping of the SHT_GNU_verneed ↵Georgii Rymar2019-12-021-14/+222
| | | | | | | | | | section. This is similar to D70495, but for SHT_GNU_verneed section. It solves the same problems: different implementations, lack of error reporting and no test coverage. DIfferential revision: https://reviews.llvm.org/D70826
* [llvm-readelf][test] - Update comment in elf-verdef-invalid.test. NFC.Georgii Rymar2019-11-291-1/+1
| | | | | It was suggested to change it during review of D70810, but I've forgotten to update it before commit.
* [llvm-readelf/llvm-readobj] - Check version of SHT_GNU_verdef section ↵Georgii Rymar2019-11-291-7/+35
| | | | | | | | | | | | | | | | | entries when dumping. Elfxx_Verdef contains the following field: vd_version Version revision. This field shall be set to 1. (https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/symversion.html) Our code should check the struct version for correctness. This patch does that. (This will help to simplify or eliminate ELFDumper<ELFT>::LoadVersionDefs() which has it's own logic to parse version definitions for no reason. It checks the struct version currently). Differential revision: https://reviews.llvm.org/D70810
* [yaml2obj] - Add a way to describe content of the SHT_GNU_verneed section ↵Georgii Rymar2019-11-291-2/+76
| | | | | | | | | with "Content". There is no way to set raw content for SHT_GNU_verneed section. This patch implements it. Differential revision: https://reviews.llvm.org/D70816
* [llvm-readelf] - Make GNU style dumping of invalid SHT_GNU_verdef be ↵Georgii Rymar2019-11-281-5/+5
| | | | | | | | | | | | consistent with LLVM style. When we dump SHT_GNU_verdef section that has sh_link that references a non-existent section, llvm-readobj reports a warning and continues dump, but llvm-readelf fails with a error. This patch fixes the issue and opens road for futher follow-ups for improving the printGNUVersionSectionProlog(). Differential revision: https://reviews.llvm.org/D70776
* [llvm-readelf][llvm-readobj][test] - Cleanup test cases for versioning sections.Georgii Rymar2019-11-283-237/+239
| | | | | | | | | | | | | | | | | | Currently we have 2 tests for testing versioning sections: 1) elf-versioninfo.test 2) elf-invalid-versioning.test The first one currently checks how versioning sections are dumped + how tools dump invalid SHT_GNU_verdef section. The second despite of its name contains only tests for invalid SHT_GNU_verneed section. In this patch I`ve renamed elf-invalid-versioning.test->elf-verneed-invalid.test, and moved a few tests from elf-versioninfo.test to a new elf-verdef-invalid.test. It will help to maintain these and a new tests for broken versioning sections. Differential revision:
* [llvm-readobj] - Always print "Predecessors" for version definition sections.Georgii Rymar2019-11-272-0/+8
| | | | | | | | | | | | | This is a follow-up discussed in D70495 thread. The current logic is unusual for llvm-readobj. It doesn't print predecessors list when it is empty. This is not good for machine parsers. D70495 had to add this condition during refactoring to reduce amount of changes, in tests, because the original code also had a similar logic. Now seems it is time to get rid of it. This patch does it. Differential revision: https://reviews.llvm.org/D70717
* [llvm-readobj/llvm-readelf] - Reimplement dumping of the SHT_GNU_verdef section.Georgii Rymar2019-11-262-5/+241
| | | | | | | | | | | | Currently we have following issues: 1) We have 2 different implementations with a different behaviors for GNU/LLVM styles. 2) Errors are either not handled at all or we call report_fatal_error with not helpfull messages. 3) There is no test coverage even for those errors that are reported. This patch reimplements parsing of the SHT_GNU_verdef section entries in a single place, adds a few error messages and test coverage. Differential revision: https://reviews.llvm.org/D70495
* [llvm-readobj][test] - Cleanup the many-sections.s test case.Georgii Rymar2019-11-263-27/+47
| | | | | | | It removes 2 precompiled binaries used which are now can be crafted with the use of yaml2obj. Differential revision: https://reviews.llvm.org/D70711
* [yaml2obj] - Fix BB after «[yaml2obj] - Teach tool to describe ↵Georgii Rymar2019-11-261-1/+1
| | | | | | | | SHT_GNU_verdef section with a "Content" property.» Fixed a temporary file name. BB: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-ubuntu/builds/669
* [yaml2obj] - Teach tool to describe SHT_GNU_verdef section with a "Content" ↵Georgii Rymar2019-11-261-2/+81
| | | | | | | | | property. There is no way to set raw content for SHT_GNU_verdef section. This patch implements it. Differential revision: https://reviews.llvm.org/D70710
* Speculative fix for frame-loclist.s test on Windows.Evgenii Stepanov2019-11-251-21/+25
| | | | "echo -e" treats windows paths as special characters (ex. "\b").
* Fix new llvm-symbolizer tests on Windows.Evgenii Stepanov2019-11-253-7/+7
| | | | A forward-slash vs backward-slash issue.
* llvm-symbolizer: fix handling of DW_AT_specification in FRAME.Evgenii Stepanov2019-11-251-0/+307
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Use getSubroutineName() to the the subrouting name; this function knows how to handle cases when DW_TAG_subprogram refers to an earlier declaration: 0x00000050: DW_TAG_subprogram DW_AT_linkage_name ("_ZN1A1fEv") DW_AT_name ("f") ... 0x00000067: DW_TAG_subprogram DW_AT_low_pc (0x0000000000000000) DW_AT_high_pc (0x0000000000000020) DW_AT_specification (0x00000050 "_ZN1A1fEv") ... 0x0000008c: DW_TAG_variable Reviewers: pcc, vitalybuka, jdoerfert Subscribers: srhines, hiraditya, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70630
* llvm-symbolizer: Support loclist in FRAME.Evgenii Stepanov2019-11-251-0/+588
| | | | | | | | | | | | | | | | Summary: Support location lists in FRAME command. These are used for the majority of local variables in optimized code. Also support DW_OP_breg in addition to DW_OP_fbreg when it refers to the same register as DW_AT_frame_base. Reviewers: pcc, jdoerfert Subscribers: srhines, hiraditya, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70629
* llvm-symbolizer: Fix FRAME handling of missing AT_name.Evgenii Stepanov2019-11-251-0/+151
| | | | | | | | | | | | | | | Summary: llvm-symbolizer protocol is empty string means end-of-output. Do not emit empty string when a function or a variable do not have a name for any reason. Emit "??". Reviewers: pcc, vitalybuka, jdoerfert Subscribers: srhines, hiraditya, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70626
* [yaml2obj/obj2yaml] - Add support for SHT_LLVM_DEPENDENT_LIBRARIES sections.Georgii Rymar2019-11-252-0/+129
| | | | | | | | | | | | | | | | | | | | | | | | This section contains strings specifying libraries to be added to the link by the linker. The strings are encoded as standard null-terminated UTF-8 strings. This patch adds a way to describe and dump SHT_LLVM_DEPENDENT_LIBRARIES sections. I introduced a new YAMLFlowString type here. That used to teach obj2yaml to dump them like: ``` Libraries: [ foo, bar ] ``` instead of the following (if StringRef would be used): ``` Libraries: - foo - bar ``` Differential revision: https://reviews.llvm.org/D70598
* [llvm-objcopy][MachO] Implement --dump-sectionSeiya Nuta2019-11-251-0/+82
| | | | | | | | | | | | Reviewers: alexshap, rupprecht, jhenderson Reviewed By: alexshap, rupprecht, jhenderson Subscribers: MaskRay, jakehehrlich, abrachet, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66408
* [Remarks] Allow empty temporary remark filesFrancis Visoiu Mistrih2019-11-229-1/+9
| | | | | | | When parsing bitstream remarks, allow external remark files to be empty, which means there are no remarks to be parsed. In the same way, dsymutil should not produce a remark file.
* [MCA] Fix test cases (NFC)Evandro Menezes2019-11-2210-30/+30
| | | | Fix the test cases for Exynos M5 that break under Darwin.
* [AArch64] Add the pipeline model for Exynos M5Evandro Menezes2019-11-2228-34/+2335
| | | | Add the scheduling and cost models for Exynos M5.
* [DWARFVerifier] Use the new location list apiPavel Labath2019-11-221-0/+7
| | | | | | | | | | | | | | | | | | Summary: Instead of going to the debug_loc section directly, use new DWARFDie::getLocations instead. This means that the code will now automatically support debug_loclists sections. This is the last usage of the old debug_loc methods, and they can now be removed. Reviewers: dblaikie, JDevlieghere, aprantl, SouraVX Subscribers: hiraditya, probinson, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70534
* [llvm-lipo] Add support for -extractAlexander Shaposhnikov2019-11-211-0/+14
| | | | | | | | This diff adds support for -extract. Test plan: make check-all Differential revision: https://reviews.llvm.org/D70522
* [llvm-objcopy][MachO] Implement --strip-debugFangrui Song2019-11-211-0/+38
| | | | | | Reviewed By: alexshap Differential Revision: https://reviews.llvm.org/D70476
* [llvm-objcopy][MachO] Fix symbol order in the symbol tableFangrui Song2019-11-212-0/+6
| | | | | | | | | | Only consider isUndefinedSymbol() when the symbol is not local. This fixes an assert failure when copying the symbol table, if a n_type=0x20 symbol is followed by a n_type=0x64 symbol. Reviewed By: alexshap, seiya Differential Revision: https://reviews.llvm.org/D70475
* dwarfdump --statistics: Use new location list apiPavel Labath2019-11-212-2/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch removes manual location list handling in the statistics code and replaces it with the new DWARFDie api, which provides access to a "cooked" location list. This has the following effects: - the code now properly handles split-dwarf location lists - it will automatically support dwarf5 location lists once support for those is added - it properly handles location lists with base address selection entries - it fixes a bug where the location list code was using the first DW_AT_ranges range as a "base address" of the compile unit (it should have used DW_AT_low_pc instead. The effect of this was that the computation of the start address of a variable in its scope was broken for these kinds of compile units. This only manifested itself on linked files, since in object files the first DW_AT_ranges range normally starts at 0. Since pretty much every kind of location list was broken in some way, it's hard to verify that the new implementation is correct -- the output will be different in all non-trivial cases, and mostly with good reason. Most of the existing statistics tests continue to pass though, and a visual inspection of the statistics for non-trivial inputs shows that the data is more "reasonable" now. I have updated the "dwo statistics" test to include the new numbers, as the previous ones were completely bogus, and I have added a targeted test for the "base address" bug. Reviewers: dblaikie, cmtice, vsk Subscribers: aprantl, SouraVX, JDevlieghere, djtodoro, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70444
* [COFF] Widen PE32Header fields to fit 64 bit versionsMartin Storsjö2019-11-211-1/+3
| | | | | | | | | | | | The PE32Header struct is only used by COFFYAML, for intermediate storage. The struct doesn't match the on-disk struct layout as it uses native integers instead of e.g. support::ulittle32_t, so just widen the fields to fit values for object::pe32plus_header, in addition to object::pe32_header. This avoids truncating the 64 bit ImageBase for 64 bit executables. Differential Revision: https://reviews.llvm.org/D70464
* Revert "[AArch64] Add the pipeline model for Exynos M5"Eric Christopher2019-11-2028-2335/+34
| | | | | | as it's causing test failures in llvm-mca. This reverts commit 9bdfee2a3bd13d405ce1592930182f23849d2897.
* [AArch64] Add the pipeline model for Exynos M5Evandro Menezes2019-11-2028-34/+2335
| | | | Add the scheduling and cost models for Exynos M5.
* [DebugInfo] Remove the DIFlagArgumentNotModified debug info flagDjordje Todorovic2019-11-203-6/+6
| | | | | | | Due to changes in D68206, we remove the DIFlagArgumentNotModified and its usage. Differential Revision: https://reviews.llvm.org/D68207
* [llvm-readobj] - Improve dumping of the SHT_LLVM_LINKER_OPTIONS sections.Georgii Rymar2019-11-201-7/+36
| | | | | | | I've added a few tests that shows how the current code could overrun the section data buffer while dumping. I had to rewrite the code to fix this. Differential revision: https://reviews.llvm.org/D70112
OpenPOWER on IntegriCloud