summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "[llvm-objdump] Add warning messages if disassembly + source for ↵Michael Pozulp2019-07-304-53/+28
| | | | | | | | | | 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-304-28/+53
| | | | | | | | | | | | | | | | | | 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] Implement -replaceAnusha Basana2019-07-292-1/+116
| | | | | | | | | 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-5/+11
| | | | | | 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-2/+6
| | | | | | | | | 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] Add support for --add-section for COFFSergey Dmitriev2019-07-262-24/+54
| | | | | | | | 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-20/+18
| | | | | | | | | | | | | | | | | | 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
* [MC] Delete unused MCInstPrinter::markup overload and getPrintHexStyleFangrui Song2019-07-251-1/+1
| | | | llvm-svn: 367000
* [llvm-objdump][NFC] Make the PrettyPrinter::printInst() output bufferedSeiya Nuta2019-07-251-16/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Every time PrettyPrinter::printInst is called, stdout is flushed and it makes llvm-objdump slow. This patches adds a string buffer to prevent stdout from being flushed. Benchmark results (./llvm-objdump-master: without this patch, ./bin/llvm-objcopy: with this patch): $ hyperfine --warmup 10 './llvm-objdump-master -d ./bin/llvm-objcopy' './bin/llvm-objdump -d ./bin/llvm-objcopy' Benchmark #1: ./llvm-objdump-master -d ./bin/llvm-objcopy Time (mean ± σ): 2.230 s ± 0.050 s [User: 1.533 s, System: 0.682 s] Range (min … max): 2.115 s … 2.278 s 10 runs Benchmark #2: ./bin/llvm-objdump -d ./bin/llvm-objcopy Time (mean ± σ): 386.4 ms ± 13.0 ms [User: 376.6 ms, System: 6.1 ms] Range (min … max): 366.1 ms … 407.0 ms 10 runs Summary './bin/llvm-objdump -d ./bin/llvm-objcopy' ran 5.77 ± 0.23 times faster than './llvm-objdump-master -d ./bin/llvm-objcopy' Reviewers: alexshap, Bigcheese, jhenderson, rupprecht, grimar, MaskRay Reviewed By: jhenderson, MaskRay Subscribers: dexonsmith, jhenderson, javed.absar, kristof.beyls, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64969 llvm-svn: 366984
* [llvm-lipo] Implement alignment function in -createShoaib Meenai2019-07-251-4/+36
| | | | | | | | | | | 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
* [Remarks][NFC] Rename remarks::Parser to remarks::RemarkParserFrancis Visoiu Mistrih2019-07-251-2/+2
| | | | llvm-svn: 366965
* Revert "[yaml2obj] - Allow custom fields for the SHT_UNDEF sections."JF Bastien2019-07-241-18/+20
| | | | | | | 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/+37
| | | | | | | | | | | | | | | | | 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
* [Remarks] Simplify the creation of remark serializersFrancis Visoiu Mistrih2019-07-241-3/+16
| | | | | | | Introduce two new functions to create a serializer, and add support for more combinations to the YAMLStrTabSerializer. llvm-svn: 366919
* [yaml2obj] - Allow custom fields for the SHT_UNDEF sections.George Rimar2019-07-241-20/+18
| | | | | | | | | | | | 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
* Recommit rr366796 "[Object/ELF.h] - Improve testing of the fields in ↵George Rimar2019-07-241-1/+1
| | | | | | | | | | | | | | | | ELFFile<ELFT>::sections()." With a fix of the issue found by UBSan. Original commit message: This eliminates a one error untested and also introduces a error for one more possible case which lead to crash previously. Differential revision: https://reviews.llvm.org/D64987 llvm-svn: 366886
* Revert "[Object/ELF.h] - Improve testing of the fields in ↵Vlad Tsyrklevich2019-07-231-1/+1
| | | | | | | | | ELFFile<ELFT>::sections()." This reverts commit r366796 because it was causing ubsan buildbot failures. llvm-svn: 366815
* [Object/ELF.h] - Improve testing of the fields in ELFFile<ELFT>::sections().George Rimar2019-07-231-1/+1
| | | | | | | | | | This eliminates a one error untested and also introduces a error for one more possible case which lead to crash previously. Differential revision: https://reviews.llvm.org/D64987 llvm-svn: 366796
* [yaml2obj] - Add a support for defining null sections in YAMLs.George Rimar2019-07-231-5/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-233-1/+27
| | | | | | | Re-commit of the patch after addressing -Wl,--emit-relocs case. Differential revision: https://reviews.llvm.org/D61672 llvm-svn: 366787
* Fix gold-plugin Windows buildYi Kong2019-07-231-2/+2
| | | | | | | r365588 missed one instance of integer file descriptor use in gold-plugin.cpp. llvm-svn: 366786
* [yaml2elf] - Treat the SHN_UNDEF section as kind of regular section.George Rimar2019-07-231-10/+13
| | | | | | | | | | | | | | 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-14/+51
| | | | | | | | | | 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
* [yaml2obj] - Change how we handle implicit sections.George Rimar2019-07-221-36/+35
| | | | | | | | | | | | | Instead of having the special list of implicit sections, that are mixed with the sections read from YAML on late stages, I just create the placeholders and add them to the main sections list early. That allows to significantly simplify the code. Differential revision: https://reviews.llvm.org/D64999 llvm-svn: 366677
* Re-commit: r366610 and r366612: Expand pseudo-components before embedding in ↵Daniel Sanders2019-07-192-1/+2
| | | | | | | | | | | | | | | | | llvm-config There were two main problems: * The 'nativecodegen' pseudo-component was unconditionally adding ${native_tgt}CodeGen even though it conditionally added ${native_tgt}Info and ${native_tgt}Desc. This has been fixed by making ${native_tgt}CodeGen conditional too * The 'all' pseudo-component was causing library names like LLVMLLVMDemangle as the expansion was to a library name and not a component. There doesn't seem to be a list of available components anywhere so this has been fixed by moving the expansion of 'all' back where it was before. This manifested in different ways on different builders but it was the same root cause llvm-svn: 366622
* Revert r366610 and r366612: Expand pseudo-components before embedding in ↵Daniel Sanders2019-07-192-2/+1
| | | | | | | | | | llvm-config Some targets are missing LLVMDemangle, one is adding the LLVM prefix twice, and two are hitting the very error this patch fixes for my target. Reverting while I work through the reports. llvm-svn: 366615
* Expand pseudo-components before embedding in llvm-configDaniel Sanders2019-07-192-1/+2
| | | | | | | | | | | | | | | | | | | | Summary: If you use pseudo-targets like AllTargetsCodeGens in LLVM_DYLIB_COMPONENTS then a test will fail because `./bin/llvm-config --shared-mode` can't handle these targets. We can fix this by expanding them before embedding the string into llvm-config Reviewers: bogner Reviewed By: bogner Subscribers: mgorny, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65011 llvm-svn: 366610
* Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFCI.Simon Pilgrim2019-07-191-1/+1
| | | | llvm-svn: 366563
* [llvm-readelf] - A fix for: "--hash-symbols asserts for 64-bit ELFs"George Rimar2019-07-191-1/+1
| | | | | | | | | 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
* [DebugInfo] Generate fixups as emitting DWARF .debug_frame/.eh_frame.Hsiangkai Wang2019-07-191-1/+1
| | | | | | | | | | | | | It is necessary to generate fixups in .debug_frame or .eh_frame as relaxation is enabled due to the address delta may be changed after relaxation. There is an opcode with 6-bits data in debug frame encoding. So, we also need 6-bits fixup types. Differential Revision: https://reviews.llvm.org/D58335 llvm-svn: 366524
* Reapply [llvm-lipo] Implement -create (with hardcoded alignments)Shoaib Meenai2019-07-182-18/+209
| | | | | | | | | | | | | | | | 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-20/+16
| | | | | | | | | | | | | 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
* Revert "[DebugInfo] Generate fixups as emitting DWARF .debug_frame/.eh_frame."Hsiangkai Wang2019-07-181-1/+1
| | | | | | This reverts commit 17e3cbf5fe656483d9016d0ba9e1d0cd8629379e. llvm-svn: 366444
* [DebugInfo] Generate fixups as emitting DWARF .debug_frame/.eh_frame.Hsiangkai Wang2019-07-181-1/+1
| | | | | | | | | | | | | It is necessary to generate fixups in .debug_frame or .eh_frame as relaxation is enabled due to the address delta may be changed after relaxation. There is an opcode with 6-bits data in debug frame encoding. So, we also need 6-bits fixup types. Differential Revision: https://reviews.llvm.org/D58335 llvm-svn: 366442
* llvm-pdbdump: Fix several smaller issues with injected source compression ↵Nico Weber2019-07-172-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [ORC] Add deprecation warnings to ORCv1 layers and utilities.Lang Hames2019-07-171-13/+12
| | | | | | | | | | | | | | | | | Summary: ORCv1 is deprecated. The current aim is to remove it before the LLVM 10.0 release. This patch adds deprecation attributes to the ORCv1 layers and utilities to warn clients of the change. Reviewers: dblaikie, sgraenitz, AlexDenisov Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64609 llvm-svn: 366344
* Teach `llvm-pdbutil pretty -native` about `-injected-sources`Nico Weber2019-07-161-7/+2
| | | | | | | | | `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-8/+1
| | | | | | This reverts r365889 (git commit 60c81354b1d3fced1bd284d334f118d2d792ab4b) llvm-svn: 366219
* [Remarks] Simplify and refactor the RemarkParser interfaceFrancis Visoiu Mistrih2019-07-162-7/+20
| | | | | | | | | | | | | | | | | | | | Before, everything was based on some kind of type erased parser implementation which container a lot of boilerplate code when multiple formats were to be supported. This simplifies it by: * the remark now owns its arguments * *always* returning an error from the implementation side * working around the way the YAML parser reports errors: catch them through callbacks and re-insert them in a proper llvm::Error * add a CParser wrapper that is used when implementing the C API to avoid cluttering the C++ API with useless state * LLVMRemarkParserGetNext now returns an object that needs to be released to avoid leaking resources * add a new API to dispose of a remark entry: LLVMRemarkEntryDispose llvm-svn: 366217
* [Remarks][NFC] Combine ParserFormat and SerializerFormatFrancis Visoiu Mistrih2019-07-161-1/+1
| | | | | | It's useless to have both. llvm-svn: 366216
* [Object/llvm-readelf/llvm-readobj] - Improve error reporting when e_shstrndx ↵George Rimar2019-07-163-10/+20
| | | | | | | | | | | | | | | | | | 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
* [llvm-readelf] Print "File: lib.a(file.o)" info when dumping archive files.Yuanfang Chen2019-07-151-5/+12
| | | | | | | | | | | | | | 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-152-209/+18
| | | | | | | | | 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-152-18/+209
| | | | | | | | | | | | 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-153-169/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-153-165/+169
| | | | | | | | | 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-153-169/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Slightly simplify MappedBlockStream::createIndexedStream() callsNico Weber2019-07-124-11/+4
| | | | | | | | | | | | | | | | All callers had a PDBFile object at hand, so call Pdb.createIndexedStream() instead, which pre-populates all the arguments (and returns nullptr for kInvalidStreamIndex). Also change safelyCreateIndexedStream() to only take the string index, and update callers. Make the method public and call it in two places that manually did the bounds checking before. No intended behavior change. Differential Revision: https://reviews.llvm.org/D64633 llvm-svn: 365936
* Add explicit newline at end of `llvm-pdbutil dump`Nico Weber2019-07-121-0/+2
| | | | | | All dump modes I checked didn't print a trailing newline, so add one. llvm-svn: 365934
* cmake: Add INSTALL_WITH_TOOLCHAIN option to add_*_library macrosTom Stellard2019-07-123-4/+7
| | | | | | | | | | | | | | | | | | | Summary: This will simplify the macros by allowing us to remove the hard-coded list of libraries that should be installed when LLVM_INSTALL_TOOLCHAIN_ONLY is enabled. Reviewers: beanz, smeenai Reviewed By: beanz Subscribers: aheejin, mehdi_amini, mgorny, steven_wu, dexonsmith, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D64580 llvm-svn: 365902
OpenPOWER on IntegriCloud