summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* [llvm-nm] Fix docs and help text for --print-sizeJames Henderson2019-06-121-1/+1
| | | | | | | | | | | | The --print-size help text and documentation claimed that the size was printed instead of the address, but this is incorrect. It is printed as well as the address. This patch fixes this issue. Reviewed by: MaskRay, mtrent, ruiu Differential Revision: https://reviews.llvm.org/D63142 llvm-svn: 363136
* [llvm-dwarfdump] Simplify --ignore-case help text and documentationJames Henderson2019-06-111-4/+3
| | | | | | | | | | | | | | | There was a typo in the --ignore-case help text that was copied into the llvm-dwarfdump command-guide. Additionally, this patch simplifies the wording, since it was unnecessarily verbose: the switch applies for searching in general and doesn't need explicitly stating different search modes (which might go out-of-date as options are added or removed). Reviwed by: JDevlieghere Differential Revision: https://reviews.llvm.org/D63133 llvm-svn: 363066
* Let writeWindowsResourceCOFF() take a TimeStamp parameterNico Weber2019-06-112-1/+24
| | | | | | | | | | | | | | | | | | | For lld, pass in Config->Timestamp (which is set based on lld's /timestamp: and /Brepro flags). Since the writeWindowsResourceCOFF() data is only used in-memory by LLD and the obj's timestamp isn't used for anything in the output, this doesn't change behavior. For llvm-cvtres, add an optional /timestamp: parameter, and use the current behavior of calling time() if the parameter is not passed in. This doesn't really change observable behavior (unless someone passes /timestamp: to llvm-cvtres, which wasn't possible before), but it removes the last unqualified call to time() from llvm/lib, which seems like a good thing. Differential Revision: https://reviews.llvm.org/D63116 llvm-svn: 363050
* [llvm-dwarfdump] Add -o to help text and remove --out-file from docJames Henderson2019-06-111-5/+4
| | | | | | | | | | | | | -o is in the documentation, but not in the llvm-dwarfdump help text. This patch adds it by inverting the -o and --out-file aliasing. It also removes --out-file from the documentation, since we don't really want people to be using this switch in practice. Reviewed by: aprantl, JDevlieghere, dblaikie Differential Revision: https://reviews.llvm.org/D63013 llvm-svn: 363044
* [yaml2elf] - Check we are able to set custom sh_link for .symtab/.dynsymGeorge Rimar2019-06-111-10/+19
| | | | | | | | | Allow using both custom numeric and string values for Link field of the dynamic and regular symbol tables. Differential revision: https://reviews.llvm.org/D63077 llvm-svn: 363042
* Symbolize: Make DWPName a symbolizer option instead of an argument to ↵Peter Collingbourne2019-06-111-6/+4
| | | | | | | | | | | | symbolize{,Inlined}Code. This makes the interface simpler and more consistent with the interface for .dSYM files and fixes a bug where llvm-symbolizer would not read the dwp if it was asked to symbolize data before symbolizing code. Differential Revision: https://reviews.llvm.org/D63114 llvm-svn: 363025
* Symbolize: Replace the Options constructor with in-class initialization. NFCI.Peter Collingbourne2019-06-117-21/+16
| | | | | | | | This is not only less code but also clearer at the use site. Differential Revision: https://reviews.llvm.org/D63113 llvm-svn: 363024
* Break a couple more false dependencies on target librariesDaniel Sanders2019-06-103-3/+11
| | | | | | | | | | | | | | | | Summary: Repeat r361567 for a few more tools. Reviewers: bogner Reviewed By: bogner Subscribers: mgorny, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62438 llvm-svn: 363011
* [dsymutil] Remove stale comment (NFC)Jonas Devlieghere2019-06-101-1/+0
| | | | | | The comment was no longer relevant after r362621. llvm-svn: 363008
* [llvm-objcopy] Fix SHT_GROUP ordering.Jordan Rupprecht2019-06-101-2/+8
| | | | | | | | | | | | | | | | | | | | | Summary: When llvm-objcopy sorts sections during finalization, it only sorts based on the offset, which can cause the group section to come after the sections it contains. This causes link failures when using gold to link objects created by llvm-objcopy. Fix this for now by copying GNU objcopy's behavior of placing SHT_GROUP sections first. In the future, we may want to remove this sorting entirely to more closely preserve the input file layout. This fixes https://bugs.llvm.org/show_bug.cgi?id=42052. Reviewers: jakehehrlich, jhenderson, MaskRay, espindola, alexshap Reviewed By: MaskRay Subscribers: phuongtrang148993, emaste, arichardson, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62620 llvm-svn: 362973
* [llvm-mca] Enable bottleneck analysis when flag -all-views is specified.Andrea Di Biagio2019-06-101-0/+1
| | | | | | | Bottleneck Analysis is one of the many views available in llvm-mca. Therefore, it should be enabled when flag -all-views is passed in input to the tool. llvm-svn: 362964
* [llvm-readobj/llvm-readelf] - Don't fail to dump the object if .dynsym has ↵George Rimar2019-06-103-1/+12
| | | | | | | | | | | | | | | broken sh_link field. This is https://bugs.llvm.org/show_bug.cgi?id=42215. GNU readelf allows to dump the objects in that case, but llvm-readobj/llvm-readelf reports an error and stops. The patch fixes that. Differential revision: https://reviews.llvm.org/D63074 llvm-svn: 362938
* [MCA] Fix -Wunused-private-field warning after r362933. NFCAndrea Di Biagio2019-06-102-3/+2
| | | | | | This should unbreak the buildbots. llvm-svn: 362935
* [MCA] Further refactor the bottleneck analysis view. NFCI.Andrea Di Biagio2019-06-103-111/+172
| | | | llvm-svn: 362933
* [yaml2obj/obj2yaml] - Make RawContentSection::Content and ↵George Rimar2019-06-102-38/+62
| | | | | | | | | | | | | | | | RawContentSection::Size optional This is a follow-up for D62809. Content and Size fields should be optional as was discussed in comments of the D62809's thread. With that, we can describe a specific string table and symbol table sections in a more correct way and also show appropriate errors. The patch adds lots of test cases where the behavior is described in details. Differential revision: https://reviews.llvm.org/D62957 llvm-svn: 362931
* [yaml2obj] - Do not assert when .dynsym is specified explicitly, but .dynstr ↵George Rimar2019-06-101-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | is not present. We have a code in buildSectionIndex() that adds implicit sections: // Add special sections after input sections, if necessary. for (StringRef Name : implicitSectionNames()) if (SN2I.addName(Name, SecNo)) { // Account for this section, since it wasn't in the Doc ++SecNo; DotShStrtab.add(Name); } The problem arises when .dynsym is specified explicitly and no DynamicSymbols is used. In that case, we do not add .dynstr implicitly and will assert later when will try to set Link for .dynsym. Seems, in this case, reasonable behavior is to allow Link field to be zero. This is what this patch does. Differential revision: https://reviews.llvm.org/D63001 llvm-svn: 362929
* Fix MSVC "32-bit shift implicitly converted to 64 bits" warning. NFCI.Simon Pilgrim2019-06-101-1/+1
| | | | llvm-svn: 362927
* [yaml2obj] - Remove helper methods that are probably excessive. NFC.George Rimar2019-06-101-17/+4
| | | | | | | | These methods are used only once. One of them is not used at all. Differential revision: https://reviews.llvm.org/D63002 llvm-svn: 362925
* fix a typo unavaliable=>unavailableSylvestre Ledru2019-06-081-1/+1
| | | | llvm-svn: 362878
* [llvm-objcopy][MachO] Recompute and update offset/size fields in the writerSeiya Nuta2019-06-085-11/+262
| | | | | | | | | | | | | | | | | | | | Summary: Recompute and update offset/size fields so that we can implement llvm-objcopy options like --only-section. This patch is the first step and focuses on supporting load commands that covered by existing tests: executable files and dynamic libraries are not supported. Reviewers: alexshap, rupprecht, jhenderson Reviewed By: alexshap, rupprecht Subscribers: compnerd, jakehehrlich, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62652 llvm-svn: 362863
* [llvm-objdump] Fix Bugzilla ID 41862 to support checking addresses of ↵Jordan Rupprecht2019-06-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | disassembled object Summary: This fixes the bugzilla id,41862 to support dealing with checking stop address against start address to support this not being a proper object to check the disasembly against like gnu objdump currently does. Reviewers: jakehehrlich, rupprecht, echristo, jhenderson, grimar Reviewed By: jhenderson Subscribers: MaskRay, smeenai, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61969 Patch by Nicholas Krause! llvm-svn: 362847
* [llvm-lipo] Drop unneeded braces. NFCShoaib Meenai2019-06-071-3/+2
| | | | llvm-svn: 362841
* [llvm-lipo] Implement -archsShoaib Meenai2019-06-072-7/+88
| | | | | | | | | | | Displays the architecture names of an input file. Unknown architectures are represented by unknown(cputype,cpusubtype). Patch by Anusha Basana <anusha.basana@gmail.com> Differential Revision: https://reviews.llvm.org/D62753 llvm-svn: 362840
* [llvm-objdump] Add warning if --disassemble-functions specifies an unknown ↵Michael Pozulp2019-06-071-0/+12
| | | | | | | | | | | | | | | | | | | | | symbol Summary: Fixes Bug 41904 https://bugs.llvm.org/show_bug.cgi?id=41904 Re-land r362768 after it was reverted in r362826. Reviewers: jhenderson, rupprecht, grimar, MaskRay Reviewed By: jhenderson, rupprecht, MaskRay Subscribers: dexonsmith, rupprecht, kristina, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62275 llvm-svn: 362838
* Unbreak 32-bit build.Peter Collingbourne2019-06-071-1/+1
| | | | llvm-svn: 362827
* Revert "[llvm-objdump] Add warning if --disassemble-functions specifies an ↵Vlad Tsyrklevich2019-06-071-12/+0
| | | | | | | | | | unknown symbol" This reverts commit 50f61af3f304a03f10d9ecb0828829f0a72d0099, it used the function introduced in the previous revert of 0bddef79019a23ab14fcdb27028e55e484674c88. llvm-svn: 362826
* Fix -Wunused-lambda-capture warning. NFCI.Simon Pilgrim2019-06-071-1/+1
| | | | llvm-svn: 362822
* llvm-objcopy: Implement --extract-partition and --extract-main-partition.Peter Collingbourne2019-06-076-36/+97
| | | | | | | | | | | | | | | | | | | This implements the functionality described in https://lld.llvm.org/Partitions.html. It works as follows: - Reads the section headers using the ELF header at file offset 0; - If extracting a loadable partition: - Finds the section containing the required partition ELF header by looking it up in the section table; - Reads the ELF and program headers from the section. - If extracting the main partition: - Reads the ELF and program headers from file offset 0. - Filters the section table according to which sections are in the program headers that it read: - If ParentSegment != nullptr or section is not SHF_ALLOC, then it goes in. - Sections containing partition ELF headers or program headers are excluded as there are no headers for these in ordinary ELF files. Differential Revision: https://reviews.llvm.org/D62364 llvm-svn: 362818
* [dsymutil] Use the number of threads specified.Jonas Devlieghere2019-06-071-3/+5
| | | | | | | | Before this patch we used either a single thread, or the number of hardware threads available, effectively ignoring the number of threads specified on the command line. llvm-svn: 362815
* [llvm-objcopy] - Emit error and don't crash if program header reaches past ↵George Rimar2019-06-071-0/+5
| | | | | | | | | | | | | | | | end of file. This is https://bugs.llvm.org/show_bug.cgi?id=42122. If an object file has a size less than program header's file [offset + size] (i.e. if we have overflow), llvm-objcopy crashes instead of reporting a error. The patch fixes this issue. Differential revision: https://reviews.llvm.org/D62898 llvm-svn: 362778
* [yaml2elf] - Refactoring followup for D62809George Rimar2019-06-071-44/+35
| | | | | | | | | | This is a refactoring follow-up for D62809 "Change how we handle implicit sections.". It allows to simplify the code. Differential revision: https://reviews.llvm.org/D62912 llvm-svn: 362777
* [CodeGen] Generic Hardware Loop SupportSam Parker2019-06-072-0/+2
| | | | | | | | | | | | | | | | | | | | | | | Patch which introduces a target-independent framework for generating hardware loops at the IR level. Most of the code has been taken from PowerPC CTRLoops and PowerPC has been ported over to use this generic pass. The target dependent parts have been moved into TargetTransformInfo, via isHardwareLoopProfitable, with HardwareLoopInfo introduced to transfer information from the backend. Three generic intrinsics have been introduced: - void @llvm.set_loop_iterations Takes as a single operand, the number of iterations to be executed. - i1 @llvm.loop_decrement(anyint) Takes the maximum number of elements processed in an iteration of the loop body and subtracts this from the total count. Returns false when the loop should exit. - anyint @llvm.loop_decrement_reg(anyint, anyint) Takes the number of elements remaining to be processed as well as the maximum numbe of elements processed in an iteration of the loop body. Returns the updated number of elements remaining. llvm-svn: 362774
* [llvm-objdump] Print source when subsequent lines in the translation unit ↵Michael Pozulp2019-06-071-2/+3
| | | | | | | | | | | | | | | | come from the same line in two different headers. Reviewers: grimar, rupprecht, jhenderson Reviewed By: grimar, jhenderson Subscribers: llvm-commits, jhenderson Tags: #llvm Differential Revision: https://reviews.llvm.org/D62461 llvm-svn: 362771
* [llvm-objdump] Add warning if --disassemble-functions specifies an unknown ↵Michael Pozulp2019-06-071-0/+12
| | | | | | | | | | | | | | | | | | symbol Summary: Fixes Bug 41904 https://bugs.llvm.org/show_bug.cgi?id=41904 Reviewers: jhenderson, rupprecht, grimar, MaskRay Reviewed By: jhenderson, rupprecht, MaskRay Subscribers: dexonsmith, rupprecht, kristina, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62275 llvm-svn: 362768
* [llvm-ar] Create thin archives with MRI scriptsOwen Reynolds2019-06-061-1/+5
| | | | | | | | This patch implements the "CREATE_THIN" MRI script command, allowing thin archives to be created via MRI scripts. Differential Revision: https://reviews.llvm.org/D62919 llvm-svn: 362704
* [dsymutil] Support more than 4 architecturesJonas Devlieghere2019-06-052-2/+3
| | | | | | | | | | | | | | When running dsymutil on a fat binary, we use temporary files in a small vector of size four. When processing more than 4 architectures, this resulted in a user-after-move, because the temporary files got moved to the heap. Instead of storing an optional temp file, we now use a unique pointer, so the location of the actual temp file doesn't change. We could test this by checking in 5 binaries for 5 different architectures, but this seems wasteful, especially since the number of elements in the small vector is arbitrary. llvm-svn: 362621
* [yaml2obj] - Change how we handle implicit sections.George Rimar2019-06-051-62/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a few sections that can be added implicitly to the output: ".dynsym", ".dynstr", ".symtab", ".strtab" and ".shstrtab". Problem appears when such section is listed explicitly in YAML. In that case it's content is written twice: first time during writing of regular sections listed in the document and second time during special handling. Because of that their file offsets can become unexpectedly broken: (yaml file for sample below lists .dynsym explicitly before .text.foo) Before patch: [Nr] Name Type Address Offset Size EntSize Flags Link Info Align [ 0] NULL 0000000000000000 00000000 0000000000000000 0000000000000000 0 0 0 [ 1] .dynsym DYNSYM 0000000000000100 00000250 0000000000000030 0000000000000018 A 6 0 8 [ 2] .text.foo PROGBITS 0000000000000200 00000200 0000000000000000 0000000000000000 AX 0 0 0 After patch: Section Headers: [Nr] Name Type Address Offset Size EntSize Flags Link Info Align [ 0] NULL 0000000000000000 00000000 0000000000000000 0000000000000000 0 0 0 [ 1] .dynsym DYNSYM 0000000000000100 00000200 0000000000000030 0000000000000018 A 6 0 8 [ 2] .text.foo PROGBITS 0000000000000200 00000230 0000000000000000 0000000000000000 AX 0 0 0 This patch reorganizes our code and fixes the issue described. Differential revision: https://reviews.llvm.org/D62809 llvm-svn: 362602
* [llvm-objdump] - Disassemble non-executable sections if specifically requested.George Rimar2019-06-051-1/+2
| | | | | | | | | | | This is https://bugs.llvm.org/show_bug.cgi?id=41897. Previously -d + -j .data had no effect, that wasn't consistent with GNU, which proccesses .data in that case. With this patch we follow this behavior. Diffeential revision: https://reviews.llvm.org/D62848 llvm-svn: 362596
* Sanitize llvm-size helpSerge Guelton2019-06-051-26/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove irrelevant options from standard help output. New output: OVERVIEW: llvm object size dumper USAGE: llvm-size [options] <input files> 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-size Options: Specify output format -A - System V format -B - Berkeley format -m - Darwin -m format --arch=<string> - architecture(s) from a Mach-O file to dump --common - Print common symbols in the ELF file. When using Berkely format, this is added to bss. Print size in radix: -o - Print size in octal -d - Print size in decimal -x - Print size in hexadecimal --format=<value> - Specify output format =sysv - System V format =berkeley - Berkeley format =darwin - Darwin -m format -l - When format is darwin, use long format to include addresses and offsets. --radix=<value> - Print size in radix =8 - Print size in octal =10 - Print size in decimal =16 - Print size in hexadecimal --totals - Print totals of all objects - Berkeley format only Differential Revision: https://reviews.llvm.org/D62482 llvm-svn: 362593
* [llvm-symbolizer] Flush output on bad inputJames Henderson2019-06-041-2/+3
| | | | | | | | | | | | | | | | | | | | One way of using llvm-symbolizer is to interactively within a process write a line from a parent process to llvm-symbolizer's stdin, and then read the output, then write the next line, read, etc. This worked as long as all the lines were good. However, this didn't work prior to this patch if any of the inputs were bad inputs, because the output is not flushed after a bad input, meaning the parent process is sat waiting for output, whilst llvm-symbolizer is sat waiting for input. This patch flushes the output after every invocation of symbolizeInput when reading from stdin. It also removes unnecessary flushing when llvm-symbolizer is not reading addresses from stdin, which should give a slight performance boost in these situations. Reviewed by: ikudrin Differential Revision: https://reviews.llvm.org/D62371 llvm-svn: 362511
* [AArch64][ELF][llvm-readobj] Add support for BTI and PAC dynamic tagsPeter Smith2019-06-041-13/+100
| | | | | | | | | | | | | | | | | | | | | | | ELF for the 64-bit Arm Architecture defines two processor-specific dynamic tags: DT_AARCH64_BTI_PLT 0x70000001, d_val DT_AARCH64_PAC_PLT 0x70000003, d_val These presence of these tags indicate that PLT sequences have been protected using Branch Target Identification and Pointer Authentication respectively. The presence of both indicates that the PLT sequences have been protected with both Branch Target Identification and Pointer Authentication. This patch adds the tags and tests for llvm-readobj and yaml2obj. As some of the processor specific dynamic tags overlap, this patch splits them up, keeping their original default value if they were not previously mentioned explicitly in a switch case. Differential Revision: https://reviews.llvm.org/D62596 llvm-svn: 362493
* [AARCH64][ELF][llvm-readobj] Support for AArch64 .note.gnu.propertyPeter Smith2019-06-041-3/+10
| | | | | | | | | | | | | | | | | | ELF for the 64-bit Arm Architecture defines a processor specific property type GNU_PROPERTY_AARCH64_FEATURE_1_AND as GNU_PROPERTY_LOPROC. This property works in a similar way to the existing X86 processor specific property GNU_PROPERTY_GNU_X86_FEATURE_1_AND. Two feature bits are defined for GNU_PROPERTY_AARCH64_FEATURE_1_AND: - GNU_PROPERTY_AARCH64_FEATURE_1_BTI 0x1 - GNU_PROPERTY_AARCH64_FEATURE_1_PAC 0x2 This patch defines the property, feature bits and implements support for printing in llvm-readobj. Differential Revision: https://reviews.llvm.org/D62595 llvm-svn: 362490
* [llvm-ar] Reapply Fix relative thin archive path handlingOwen Reynolds2019-06-041-9/+29
| | | | | | | | | | Includes a fix for an introduced build failure due to a post c++11 use of std::mismatch. This fixes some thin archive relative path issues, paths are shortened where possible and paths are output correctly when using the display table command. Differential Revision: https://reviews.llvm.org/D59491 llvm-svn: 362484
* [PDB] Copy inlinee lines records into the PDBReid Kleckner2019-06-031-0/+4
| | | | | | | | | | | | | | | | | | Summary: - Fixes inline call frame line table display in windbg. - Improve llvm-pdbutil to dump extra file ids. - Warn on unknown subsections so we don't have this kind of bug in the future. Reviewers: inglorion, akhuang, aganea Subscribers: eraman, zturner, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62701 llvm-svn: 362429
* Revert "[llvm-ar] Fix relative thin archive path handling"Dmitri Gribenko2019-06-031-29/+9
| | | | | | | | | | This reverts commit r362407. It broke compilation of llvm/lib/Object/ArchiveWriter.cpp: error: type 'llvm::sys::path::const_iterator' does not provide a call operator llvm-svn: 362413
* [llvm-ar] Fix relative thin archive path handlingOwen Reynolds2019-06-031-9/+29
| | | | | | | | This fixes some thin archive relative path issues, paths are shortened where possible and paths are output correctly when using the display table command. Differential Revision: https://reviews.llvm.org/D59491 llvm-svn: 362407
* [llvm-objcopy] test commitAlex Brachet2019-06-011-1/+1
| | | | llvm-svn: 362289
* [COFF, ARM64] Add CodeView register mappingTom Tan2019-05-313-18/+40
| | | | | | | | | | | | | | | | CodeView has its own register map which is defined in cvconst.h. Missing this mapping before saving register to CodeView causes debugger to show incorrect value for all register based variables, like variables in register and local variables addressed by register (stack pointer + offset). This change added mapping between LLVM register and CodeView register so the correct register number will be stored to CodeView/PDB, it aso fixed the mapping from CodeView register number to register name based on current CPUType but print PDB to yaml still assumes X86 CPU and needs to be fixed. Differential Revision: https://reviews.llvm.org/D62608 llvm-svn: 362280
* [codeview] Revert inline line table change of r362264Reid Kleckner2019-05-311-0/+4
| | | | | | | | | | | | Testing with debuggers shows that our previous behavior was correct. The reason I thought MSVC did things differently is that MSVC prefers to use the 0xB combined code offset and code length update opcode when inline sites are discontiguous. Keep the test changes, and update the llvm-pdbutil inline line table dumper to account for this new interpretation of the opcodes. llvm-svn: 362277
* [Bugpoint] fix another use-after-move. NFCNick Desaulniers2019-05-311-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: This was flagged in https://www.viva64.com/en/b/0629/ under "Snippet No. 7". These statements are order independent, short of the use-after-move. Reviewers: echristo, srhines, RKSimon Reviewed By: RKSimon Subscribers: dblaikie, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62114 llvm-svn: 362267
OpenPOWER on IntegriCloud