summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* [tests][go]Add -stdlib=libc++ to build GO test if LLVM is built with libc++Xing Xue2019-05-161-1/+7
| | | | | | | | | | | | | | | | When libc++ is used to build LLVM libraries, these libraries have dependencies on libc++ and C++ STL signatures in these libraries are corresponding to libc++ implementation. Therefore, -stdlib=libc++ is required on the C++ compiler command for building GO tests that link with these LLVM libraries. Reviewers: hubert.reinterpretcast, sfertile, amyk, EricWF Reviewed By: sfertile, hubert.reinterpretcast Subscribers: jsji, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61900 llvm-svn: 360895
* Recommit [Object] Change object::SectionRef::getContents() to return ↵Fangrui Song2019-05-1614-96/+92
| | | | | | | | | | | | Expected<StringRef> r360876 didn't fix 2 call sites in clang. Expected<ArrayRef<uint8_t>> may be better but use Expected<StringRef> for now. Follow-up of D61781. llvm-svn: 360892
* Revert r360876 "[Object] Change object::SectionRef::getContents() to return ↵Hans Wennborg2019-05-1614-92/+96
| | | | | | | | | | | | Expected<StringRef>" It broke the Clang build, see llvm-commits thread. > Expected<ArrayRef<uint8_t>> may be better but use Expected<StringRef> for now. > > Follow-up of D61781. llvm-svn: 360878
* [Object] Change object::SectionRef::getContents() to return Expected<StringRef>Fangrui Song2019-05-1614-96/+92
| | | | | | | | Expected<ArrayRef<uint8_t>> may be better but use Expected<StringRef> for now. Follow-up of D61781. llvm-svn: 360876
* [llvm-readobj] - Revert r360676 partially. NFC.George Rimar2019-05-161-472/+489
| | | | | | | | | | | In the r360676 "Apply clang format. NFC" I applied clang-format for whole ELFDumper.cpp. It caused a little discussion, one of the points mentioned was that previously nicely lined up tables are not so nice now. This patch reverts them. llvm-svn: 360860
* [codeview] Finish support for reading and writing S_ANNOTATION recordsReid Kleckner2019-05-151-0/+9
| | | | | | Implement dumping via llvm-pdbutil and llvm-readobj. llvm-svn: 360813
* [llvm-readobj] - Apply clang format. NFC.George Rimar2019-05-141-587/+564
| | | | | | I am a bit tired of the formatting issues. llvm-svn: 360676
* AArch64: support binutils-like things on arm64_32.Tim Northover2019-05-141-2/+27
| | | | | | | | 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
* [llvm-objcopy] Cache gnu_debuglink's target CRCJames Henderson2019-05-145-20/+30
| | | | | | | | | | | | | | | | | | | | | | .gnu_debuglink section contains information regarding file with debugging symbols, identified by its CRC32. This target file is not intended to ever change or it would invalidate the stored checksum, yet the checksum is calculated over and over again for each of the objects inside the archive, usually hundreds of times. This patch precomputes the CRC32 of the target once and then reuses the value where required, saving lots of redundant I/O. The error message reported should stay the same, although now it might be reported earlier. Reviewed by: jhenderson, jakehehrlich, MaskRay Differential Revision: https://reviews.llvm.org/D61343 Patch by Michal Janiszewski llvm-svn: 360661
* [Object] Change ObjectFile::getSectionContents to return ↵Fangrui Song2019-05-144-12/+11
| | | | | | | | | | | | | | | | | | | Expected<ArrayRef<uint8_t>> Change std::error_code getSectionContents(DataRefImpl, StringRef &) const; to Expected<ArrayRef<uint8_t>> getSectionContents(DataRefImpl) const; Many object formats use ArrayRef<uint8_t> as the underlying type, which is generally better than StringRef to represent binary data, so change the type to decrease the number of type conversions. Reviewed By: ruiu, sbc100 Differential Revision: https://reviews.llvm.org/D61781 llvm-svn: 360648
* Simplify llvm-cat helpSerge Guelton2019-05-131-3/+9
| | | | | | | | Only output options that are directly relevant. Differential Revision: https://reviews.llvm.org/D61740 llvm-svn: 360575
* [JITLink] Add a test for zero-filled content.Lang Hames2019-05-123-24/+44
| | | | | | | | Also updates RuntimeDyldChecker and llvm-rtdyld to support zero-fill tests by returning a content address of zero (but no error) for zero-fill atoms, and treating loads from zero as returning zero. llvm-svn: 360547
* [NFC] yaml2obj/yam2elf.cpp whitespace changes: dos2unix removed CRs.Puyan Lotfi2019-05-111-32/+32
| | | | llvm-svn: 360527
* [COFF] Fix .bss section size bug in obj2yaml / yaml2objReid Kleckner2019-05-101-2/+3
| | | | | | | | | We need to serialize SizeOfRawData through even when there is no data, as in a .bss section. Fixes PR41836 llvm-svn: 360473
* [llvm-objdump] Print st_otherFangrui Song2019-05-101-6/+24
| | | | | | | | | | | Add support for ".hidden" ".internal" ".protected" and " 0x%02x" for other st_other bits used by some architectures. Reviewed By: sfertile Differential Revision: https://reviews.llvm.org/D61718 llvm-svn: 360439
* [Object] Fix macho-invalid.testFangrui Song2019-05-101-2/+3
| | | | llvm-svn: 360420
* [Object] Change SymbolicFile::printSymbolName to use ErrorFangrui Song2019-05-103-7/+8
| | | | llvm-svn: 360414
* llvm-dwarfdump: Add dwo parsing to --statistics.Caroline Tice2019-05-091-1/+1
| | | | | | | | | | | Add check for, and parsing of, .dwo files to Statistics.cpp; create a new getNon SkeletonUnitDie function for DWARFUnit.h Reviewers: dblaikie Differential Revision: https://review.llvm.org/D61755 llvm-svn: 360380
* [llvm-cxxfilt] Fix -Wshadow warning. NFCI.Simon Pilgrim2019-05-091-9/+10
| | | | | | Local variable Decorated was shadowing the global variable Decorated llvm-svn: 360352
* [MCA] Add support for nested and overlapping region markersAndrea Di Biagio2019-05-094-27/+88
| | | | | | | | | | | | | | | | | | | | | | | This patch fixes PR41523 https://bugs.llvm.org/show_bug.cgi?id=41523 Regions can now nest/overlap provided that they have different names. Anonymous regions cannot overlap. Region end markers must specify the region name. The only exception is for when there is only one user-defined region; in that particular case, the region end marker doesn't need to specify a name. Incorrect region end markers are no longer ignored. Instead, the tool reports an error and we exit with an error code. Added test cases to verify the new diagnostic error messages. Updated the llvm-mca docs to reflect this feature change. Differential Revision: https://reviews.llvm.org/D61676 llvm-svn: 360351
* [llvm-nm] Fix handling of symbol types 't' 'd' 'r'Fangrui Song2019-05-091-20/+7
| | | | | | | | | | | | | | | | | | | This restores part of r359311 that was reverted by r359830. Rewrite the symbol types to fix several issues. Notable difference is that the type of __init_array_start changes from 't' to 'd'. GNU nm used to mark ELF symbols relative to .init_array as 't' https://sourceware.org/bugzilla/show_bug.cgi?id=24505 (before 2.33) because ".init" is the prefix. The bug was copied by r287803. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D61551 llvm-svn: 360339
* [llvm-objcopy] Improve error message for unrecognised archive memberJames Henderson2019-05-081-6/+6
| | | | | | | | | | | | | | Prior to this patch, llvm-objcopy's error messages for archives with unsupported members only mentioned the archive name, not the member name, making them unhelpful. This change improves it by approximately following GNU objcopy's error message syntax of "<archive name>(<member name>): <problem>". Reviewed by: grimar Differential Revision: https://reviews.llvm.org/D61674 llvm-svn: 360251
* [MCA] Don't add a name to the default code region.Andrea Di Biagio2019-05-083-5/+4
| | | | | | This is done in preparation for a patch that fixes PR41523. llvm-svn: 360243
* [MCA] Slightly refactor CodeRegion.h. NFCIAndrea Di Biagio2019-05-082-24/+22
| | | | | | Also, use a SmallVector instead of a std::vector for the code region. llvm-svn: 360240
* [llvm-objcopy] Add --prefix-alloc-sectionsJames Henderson2019-05-085-10/+73
| | | | | | | | | | | | | | | | This patch adds support for --prefix-alloc-sections, which adds a prefix to every allocated section names. It adds a prefix after renaming section names by --rename-section as GNU objcopy does. Fixes PR41266: https://bugs.llvm.org/show_bug.cgi?id=41266 Differential Revision: https://reviews.llvm.org/D60042 Patch by Seiya Nuta. llvm-svn: 360233
* [llvm-objcopy] - Fix for "Bug 41775 - SymbolTableSection::addSymbol - shadow ↵George Rimar2019-05-082-3/+3
| | | | | | | | | | | | | | | | | | | variable names" This is a fix for https://bugs.llvm.org/show_bug.cgi?id=41775, Problem is in the final line: Size += this->EntrySize; I checked that we do not actually need it in this place, since we always call removeSectionReferences which calls removeSymbols which updates the Size. But it worth to keep it, that allows to relax the dependencies. Differential revision: https://reviews.llvm.org/D61636 llvm-svn: 360227
* [llvm-objdump] - Print relocation record in a GNU format.George Rimar2019-05-071-11/+23
| | | | | | | | | | | | | | | This fixes the https://bugs.llvm.org/show_bug.cgi?id=41355. Previously with -r we printed relocation section name instead of the target section name. It was like this: "RELOCATION RECORDS FOR [.rel.text]" Now it is: "RELOCATION RECORDS FOR [.text]" Also when relocation target section has more than one relocation section, we did not combine the output. Now we do. Differential revision: https://reviews.llvm.org/D61312 llvm-svn: 360143
* [llvm-exegesis] BenchmarkRunner::runConfiguration(): write small snippet to ↵Roman Lebedev2019-05-071-7/+6
| | | | | | | | | | | | | memory It was previously writing this temporary snippet to file, then reading it back, but leaving the tmp file in place. This is both unefficient, and results in huge garbage pileup in /tmp. One would have thought it would have been caught during D60317.. llvm-svn: 360138
* [yaml2obj] - Allow setting st_value explicitly for Symbol.George Rimar2019-05-071-46/+53
| | | | | | | | | | In some cases it is useful to explicitly set symbol's st_name value. For example, I am using it in a patch for LLD to remove the broken binary from a test case and replace it with a YAML test. Differential revision: https://reviews.llvm.org/D61180 llvm-svn: 360137
* [llvm-exegesis] InstructionBenchmark::writeYamlTo(): don't forget to flush()Roman Lebedev2019-05-071-0/+2
| | | | | | | | | | | | This *APPEARS* to fix a *very* infuriating issue of Yaml's being corrupted, partially written, truncated. Or at least i'm not seeing the issue on a new benchmark sweep. The issue is somewhat rare, happens maybe once in 1000 benchmarks. Which means there are up to hundreds of broken benchmarks for a full x86 sweep in a single mode. llvm-svn: 360124
* [WebAssembly] Add more test coverage for reloctions against section symbolsSam Clegg2019-05-071-5/+0
| | | | | | | | | | | | | The only known user of this relocation type and symbol type is the debug info sections, but we were not testing the `--relocatable` output path. This change adds a minimal test case to cover relocations against section symbols includes `--relocatable` output. Differential Revision: https://reviews.llvm.org/D61623 llvm-svn: 360110
* [DebugInfo] Delete TypedDINodeRefFangrui Song2019-05-071-2/+2
| | | | | | | | | | | | | TypedDINodeRef<T> is a redundant wrapper of Metadata * that is actually a T *. Accordingly, change DI{Node,Scope,Type}Ref uses to DI{Node,Scope,Type} * or their const variants. This allows us to delete many resolve() calls that clutter the code. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D61369 llvm-svn: 360108
* Remove duplicate assignments. NFCI.Simon Pilgrim2019-05-062-3/+0
| | | | llvm-svn: 360064
* [llvm-c-test] Make include-all.c do what its name says it doesAnders Waldenborg2019-05-061-1/+16
| | | | | | | | | | | The purpose of this file is to make sure that all includes in llvm-c works when included from a C source file (i.e no C++isms sneaked in). To do this it must actually include all the include files. Reviewed By: whitequark Differential Revision: https://reviews.llvm.org/D61567 llvm-svn: 360033
* Let --discard-all imply --strip-debug.Sid Manning2019-05-031-0/+5
| | | | | | | | This will match gnu strip's behavior. Differential Revision: https://reviews.llvm.org/D61092 llvm-svn: 359887
* Avoid cppcheck operator precedence warnings. NFCI.Simon Pilgrim2019-05-031-1/+1
| | | | | | Prefer ((X & Y) ? A : B) to (X & Y ? A : B) llvm-svn: 359884
* [Object][XCOFF] Add an XCOFF dumper for llvm-readobj.Sean Fertile2019-05-034-0/+128
| | | | | | | | | | | Patch adds support for dumping of file headers with llvm-readobj. XCOFF object files are added to test dumping a well formed file, and dumping both negative timestamps and negative symbol counts, both of which are allowed in the XCOFF definition. Differential Revision: https://reviews.llvm.org/D60878 llvm-svn: 359878
* Revert [llvm-nm] Fix handling of symbol types + [llvm-nm] Generalize symbol ↵Jordan Rupprecht2019-05-021-11/+28
| | | | | | | | types This reverts r359311 and r359312 (git commit 0bf06a8f59b0074a60871865e828d92db8930c59 and 5f184f17800ea2ac27be5e4ab540cb94a46e80c7) llvm-svn: 359830
* lld-link: Add /force:multipleres extension to make dupe resource diag non-fatalNico Weber2019-05-021-1/+4
| | | | | | | As a side benefit, lld-link now reports more than one duplicate resource entry before exiting with an error even if the new flag is not passed. llvm-svn: 359829
* [yaml2obj] - Make interface of `NameToIdxMap` class be human friendly and ↵George Rimar2019-05-021-77/+78
| | | | | | | | | | | | | fix users. This patch inverses the values returned by `addName` and `lookup` methods of the class mentioned so that they now return true on success and false on failure. Also, it does minor code cleanup. Differential revision: https://reviews.llvm.org/D61190 llvm-svn: 359818
* [llvm-strip]Add --no-strip-all to disable --strip-all behaviour (including ↵James Henderson2019-05-022-3/+7
| | | | | | | | | | | | | | | | | default stripping) If certain switches are not specified, llvm-strip behaves as if --strip-all were specified. This means that for testing, when we don't want the stripping behaviour, we have to specify one of these switches, which can be confusing. This change adds --no-strip-all to allow an alternative way of suppressing the default stripping, in a less confusing manner. Reviewed by: jakehehrlich, MaskRay Differential Revision: https://reviews.llvm.org/D61377 llvm-svn: 359781
* [llvm-readobj] Delete and inline relocAddressLessFangrui Song2019-05-023-7/+3
| | | | | | | It is used only once in COFFDumper.cpp. Deleting it from the public interface seems better. llvm-svn: 359775
* [Object] Change getSectionName() to return Expected<StringRef>Fangrui Song2019-05-026-53/+46
| | | | | | | | | | Summary: It currently receives an output parameter and returns std::error_code. Expected<StringRef> fits for this purpose perfectly. Differential Revision: https://reviews.llvm.org/D61421 llvm-svn: 359774
* [llvm-objdump] Print newlines before and after "Disassembly of section ...:"Fangrui Song2019-05-011-2/+2
| | | | | | | | | | | This improves readability and the behavior is consistent with GNU objdump. The new test test/tools/llvm-objdump/X86/disassemble-section-name.s checks we print newlines before and after "Disassembly of section ...:" Differential Revision: https://reviews.llvm.org/D61127 llvm-svn: 359668
* [yaml2obj] - Report when unknown section is referenced from program header ↵George Rimar2019-05-011-28/+24
| | | | | | | | | | | | declaration block. Previously we did not report this. Also this removes multiple lookups in the map what cleanups the code. Differential revision: https://reviews.llvm.org/D61322 llvm-svn: 359663
* [llvm-readobj] Change -long-option to --long-option in tests. NFCFangrui Song2019-05-011-57/+57
| | | | | | | | | | We use both -long-option and --long-option in tests. Switch to --long-option for consistency. In the "llvm-readelf" mode, -long-option is discouraged as it conflicts with grouped short options and it is not accepted by GNU readelf. While updating the tests, change llvm-readobj -s to llvm-readobj -S to reduce confusion ("s" is --section-headers in llvm-readobj but --symbols in llvm-readelf). llvm-svn: 359649
* [llvm-objcopy] Simplify SHT_NOBITS -> SHT_PROGBITS promotionFangrui Song2019-05-011-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GNU objcopy uses bfd_elf_get_default_section_type to decide the candidate section type, which roughly translates to our [a] (I assume SEC_COMMON implies SHF_ALLOC): (!(Sec.Flags & ELF::SHF_ALLOC) || Flags & (SectionFlag::SecContents | SectionFlag::SecLoad))) Then, it updates the section type in bfd/elf.c:elf_fake_sections if: if (this_hdr->sh_type == SHT_NULL) this_hdr->sh_type = sh_type; // common case else if (this_hdr->sh_type == SHT_NOBITS && sh_type == SHT_PROGBITS && (asect->flags & SEC_ALLOC) != 0) // uncommon case ... this_hdr->sh_type = sh_type; If the following condition is met the uncommon branch is executed: if (elf_section_type (osec) == SHT_NULL && (osec->flags == isec->flags || (final_link && ((osec->flags ^ isec->flags) & ~(SEC_LINK_ONCE | SEC_LINK_DUPLICATES | SEC_RELOC)) == 0))) I suggest we just ignore this clause and follow the common case behavior, which is done in this patch. Rationales to do so: If --set-section-flags is a no-op (osec->flags == isec->flags) (corresponds to the "readonly" test in set-section-flags.test), GNU objcopy will require (Sec.Flags & ELF::SHF_ALLOC). [a] is essentially: Flags & (SectionFlag::SecContents | SectionFlag::SecLoad) This special case is not really useful. Non-SHF_ALLOC SHT_NOBITS sections do not make much sense and it doesn't matter if they are SHT_NOBITS or SHT_PROGBITS. For all other RUN lines in set-section-flags.test, the new behavior matches GNU objcopy, i.e. this patch improves compatibility. Differential Revision: https://reviews.llvm.org/D60189 llvm-svn: 359639
* [llvm-profdata] Add overlap command to compute similarity b/w two profile filesRong Xu2019-04-301-2/+89
| | | | | | | | | Add overlap functionality to llvm-profdata tool to compute the similarity between two profile files. Differential Revision: https://reviews.llvm.org/D60977 llvm-svn: 359612
* [WebAssembly] Support EXPLICIT_NAME symbols in llvm-readobjDan Gohman2019-04-301-0/+1
| | | | | | | | | Teach llvm-readobj about WASM_SYMBOL_EXPLICIT_NAME. Differential Revision: https://reviews.llvm.org/D61323 Reviewer: sbc100 llvm-svn: 359602
* [llvm-objcopy] Add RISC-V support for -B/-OJordan Rupprecht2019-04-301-4/+15
| | | | | | | | | | | | Reviewers: jorgbrown, espindola, alexshap, jhenderson Subscribers: emaste, arichardson, fedor.sergeev, jakehehrlich, kito-cheng, shiva0217, MaskRay, rogfer01, rkruppe, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61272 llvm-svn: 359568
OpenPOWER on IntegriCloud