summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* llvm-config: emit the C++ standard flag into CXXFLAGSSaleem Abdulrasool2019-11-011-4/+3
| | | | | | | This recovers the now "missing" flag as this is controlled by CMake rather than injected into the user defined flags list. This is primarily needed by LDC and other out-of-tree users which do not correctly setup the C++ flags.
* [NFC][llvm-readobj] Split getSectionIndexName function into twoJames Henderson2019-11-011-36/+48
| | | | | | | | | | | | | | | | | | | getSectionIndexName was trying to fetch two things at once, which led to a somewhat tricky to understand interface involving passing output parameters in, and also made it hard to return Errors further up the stack. This change is in preparation for changing the error handling. Additionally, update a related test now that yaml2obj supports SHT_SYMTAB_SHNDX properly (see d3963051c490), and add missing LLVM-style coverage for symbols with shndx SHN_XINDEX. This test (after fixing) caught a mistake in my first attempt at this patch, hence I'm including it as part of this patch. Reviewed by: grimar, MaskRay Differential Revision: https://reviews.llvm.org/D69670
* [NFC][llvm-readobj] Pull common code into a helperJames Henderson2019-11-011-18/+13
| | | | | | | | This will make planned changes to this code easier to make. Reviewed by: MaskRay, grimar Differential Revision: https://reviews.llvm.org/D69669
* [llvm-objcopy] --add-symbol: address post-commit reviews of D69093Fangrui Song2019-10-311-17/+18
| | | | | | | | | | * Improve comments. * Reorder the assignment to Obj.SectionNames before the symbol table creation code. Add a test. Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D69526
* [llvm-objcopy] Preserve .ARM.attributes section when stripping filesJames Henderson2019-10-312-1/+8
| | | | | | | | | | | | | | This works around a bug in Debian's patchset for glibc. The bug is described in detail in the upstream debian bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=943798, but the short version of it is that glibc on any Debian based distro don't load libraries unless it has a .ARM.attribute section. Reviewed by: jhenderson, rupprecht, MaskRay, jakehehrlich Differential Revision: https://reviews.llvm.org/D69188 Patch by Tobias Hieta.
* [yaml2obj/obj2yaml] - Add support for SHT_GNU_HASH section.georgerim2019-10-311-0/+59
| | | | | | | This adds parsing and dumping support for GNU hash sections. They are described nicely here: https://blogs.oracle.com/solaris/gnu-hash-elf-sections-v2 Differential revision: https://reviews.llvm.org/D69399
* [llvm-readelf/llvm-readobj] - Improve dumping of broken versioning sections.Georgii Rymar2019-10-311-11/+31
| | | | | | | | This updates the elf-invalid-versioning.test test case: makes a cleanup, adds llvm-readobj calls and fixes 2 crash/assert issues I've found (test cases are provided). Differential revision: https://reviews.llvm.org/D68705
* [llvm-objcopy][MachO] Implement --strip-allSeiya Nuta2019-10-313-6/+60
| | | | | | | | | | | | Reviewers: alexshap, rupprecht, jdoerfert, jhenderson Reviewed By: alexshap Subscribers: jakehehrlich, abrachet, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66281
* Revert "[NFC] Rename LLVM_NO_DEAD_STRIP"David Tenty2019-10-303-3/+3
| | | | This reverts commit 11c2a85db8849db1a5907e80d9966592248ef825.
* [LegacyPassManager] Delete BasicBlockPass/Manager.Alina Sbirlea2019-10-304-71/+30
| | | | | | | | | | | | | | | | Summary: Delete the BasicBlockPass and BasicBlockManager, all its dependencies and update documentation. The BasicBlockManager was improperly tested and found to be potentially broken, and was deprecated as of rL373254. In light of the switch to the new pass manager coming before the next release, this patch is a first cleanup of the LegacyPassManager. Reviewers: chandlerc, echristo Subscribers: mehdi_amini, sanjoy.google, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69121
* [bugpoint] Reduce metadata that does not contribute to crash.Florian Hahn2019-10-302-1/+123
| | | | | | | | | | | | | | Add a new reducer that drops metadata that does not contribute to the crash from instructions. It adjusts the metadata.ll test case, as now also the instruction level metadata will get dropped. Reviewers: davide, reames, modocache Reviewed By: reames Differential Revision: https://reviews.llvm.org/D69234
* [llvm-objcopy] - Do not crash on object that has relocations but no symbol ↵Georgii Rymar2019-10-301-5/+16
| | | | | | | | | | | | | table. It was revealed by D69260. Tool crashed when scanned relocations in a object without a symbol table. This patch teaches it either to handle such objects (when relocations does not use symbols we do not need a symbol table to proceed) or to show an appropriate error otherwise. Differential revision: https://reviews.llvm.org/D69304
* [llvm-objcopy][MachO] Support indirect symbol tableSeiya Nuta2019-10-303-9/+32
| | | | | | | | | | | | | | | | | Summary: Parse the indirect symbol table and update the indexes of symbol entries in the table in the writer in case they have been changed. Reviewers: alexshap, rupprecht, jhenderson Reviewed By: alexshap, rupprecht Subscribers: jakehehrlich, abrachet, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66280
* [lli-child-target] Fix -DBUILD_SHARED_LIBS=on buildFangrui Song2019-10-291-0/+1
|
* [lli] Fix -DBUILD_SHARED_LIBS=on buildFangrui Song2019-10-291-0/+1
| | | | | | | | | | This fixes: ld.lld: error: undefined symbol: vtable for llvm::orc::rpc::ResponseAbandoned >>> referenced by lli.cpp In -DBUILD_SHARED_LIBS=on builds, all directly referenced references must be linked to appease -Wl,-z,defs.
* Revert "[llvm-cov] Add option to whitelist filenames"Vlad Tsyrklevich2019-10-2910-62/+20
| | | | | | This reverts commit bfed824b57d14e2ba98ddbaf1a1410cf04a3e279, the included test fails on many bots including the sanitier bots, e.g. in http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/36140
* [llvm-cov] Add option to whitelist filenamesVedant Kumar2019-10-2910-20/+62
| | | | | | | | | Add the `-whitelist-filename-regex` option to restrict coverage reporting to file paths that match a whitelist regex. Patch by Michael Daniels! rdar://56720320
* Break out OrcError and RPCChris Bieneman2019-10-291-1/+1
| | | | | | | | | | | | | | | | | | | Summary: When createing an ORC remote JIT target the current library split forces the target process to link large portions of LLVM (Core, Execution Engine, JITLink, Object, MC, Passes, RuntimeDyld, Support, Target, and TransformUtils). This occurs because the ORC RPC interfaces rely on the static globals the ORC Error types require, which starts a cycle of pulling in more and more. This patch breaks the ORC RPC Error implementations out into an "OrcError" library which only depends on LLVM Support. It also pulls the ORC RPC headers into their own subdirectory. With this patch code can include the Orc/RPC/*.h headers and will only incur link dependencies on LLVMOrcError and LLVMSupport. Reviewers: lhames Reviewed By: lhames Subscribers: mgorny, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68732
* [bugpoint] Try to reduce passes after reducing everything.Florian Hahn2019-10-291-1/+15
| | | | | | | | | | | | | | | | In some cases, we fail to reduce the pass list earlier because of complex pass dependencies, but we can reduce it after we simplified the reproducer. An example of that is PR43474, which can limit the crash to -loop-interchange. Adding a test case would require at least 2 interacting Loop passes I think. Reviewers: davide, reames, modocache Reviewed By: reames Differential Revision: https://reviews.llvm.org/D69236
* [llvm-objcopy][MachO] Implement --only-sectionSeiya Nuta2019-10-284-5/+30
| | | | | | | | | | | | Reviewers: alexshap, rupprecht, jdoerfert, jhenderson Reviewed By: alexshap, rupprecht, jhenderson Subscribers: mgorny, jakehehrlich, abrachet, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65541
* [llvm-objcopy][MachO] Add support for min os version load commandsAlexander Shaposhnikov2019-10-251-0/+3
| | | | | | | | Add support for min os version load commands. Test plan: make check-all Differential revision: https://reviews.llvm.org/D69419
* [NFC] Rename LLVM_NO_DEAD_STRIPDavid Tenty2019-10-253-3/+3
| | | | | | | | | | | | | | | | | Summary: The variable LLVM_NO_DEAD_STRIP is set in LLVM cmake files when building executables that might make use of plugins .The name of the variable does not convey the actual intended usage (i.e. for use with tools that have plugins), just what the eventual effect of setting in on some (i.e. not garbage collecting unused symbols). This patch renames it to LLVM_SUPPORT_PLUGINS to convey the intended usage, which will allow subsequent patches to add behavior to support that in different ways without confusion about whether it will do on, for example, non-gnu platforms. Reviewers: hubert.reinterpretcast, stevewan Reviewed By: stevewan Subscribers: cfe-commits, mgorny, llvm-commits Tags: #llvm, #clang Differential Revision: https://reviews.llvm.org/D69356
* [yaml2obj, obj2yaml] - Add support for SHT_NOTE sections.georgerim2019-10-251-0/+46
| | | | | | | | | | | | | | | | | | | | | SHT_NOTE is the section that consists of namesz, descsz, type, name + padding, desc + padding data. This patch teaches yaml2obj, obj2yaml to dump and parse them. This patch implements the section how it is described here: https://docs.oracle.com/cd/E23824_01/html/819-0690/chapter6-18048.html Which says: "For 64–bit objects and 32–bit objects, each entry is an array of 4-byte words in the format of the target processor" The official specification is different http://www.sco.com/developers/gabi/latest/ch5.pheader.html#note_section And says: "n 64-bit objects (files with e_ident[EI_CLASS] equal to ELFCLASS64), each entry is an array of 8-byte words in the format of the target processor. In 32-bit objects (files with e_ident[EI_CLASS] equal to ELFCLASS32), each entry is an array of 4-byte words in the format of the target processor" Since LLVM uses the first, 32-bit way, this patch follows it. Differential revision: https://reviews.llvm.org/D68983
* [obj2yaml] - Better dumping for relocations without symbols associated.georgerim2019-10-251-13/+11
| | | | | | | | | This just reorders the code and removes an assignment of an empty string for the case when a relocation has no symbol associated. With this our output becomes cleaner and shorter. Differential revision: https://reviews.llvm.org/D69255
* [llvm-ifs][NFC] Adds TODO comment for dropping ObjectFileFormat on yaml format.Puyan Lotfi2019-10-241-0/+1
|
* [Mips] Use appropriate private label prefix based on Mips ABIMirko Brkusanin2019-10-2314-23/+48
| | | | | | | | | | MipsMCAsmInfo was using '$' prefix for Mips32 and '.L' for Mips64 regardless of -target-abi option. By passing MCTargetOptions to MCAsmInfo we can find out Mips ABI and pick appropriate prefix. Tags: #llvm, #clang, #lldb Differential Revision: https://reviews.llvm.org/D66795
* Prune Pass.h include from DataLayout.h. NFCIBjorn Pettersson2019-10-211-0/+1
| | | | | | | | | | | | | | | | | | | Summary: Reduce include dependencies by no longer including Pass.h from DataLayout.h. That include seemed irrelevant to DataLayout, as well as being irrelevant to several users of DataLayout. Reviewers: rnk Reviewed By: rnk Subscribers: mehdi_amini, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D69261 llvm-svn: 375436
* [llvm/Object] - Make ELFObjectFile::getRelocatedSection return ↵George Rimar2019-10-213-7/+34
| | | | | | | | | | | | | Expected<section_iterator> It returns just a section_iterator currently and have a report_fatal_error call inside. This change adds a way to return errors and handle them on caller sides. The patch also changes/improves current users and adds test cases. Differential revision: https://reviews.llvm.org/D69167 llvm-svn: 375408
* [yaml2obj][obj2yaml] - Do not create a symbol table by default.George Rimar2019-10-201-2/+6
| | | | | | | | | | | | | | | | | | This patch tries to resolve problems faced in D68943 and uses some of the code written by Konrad Wilhelm Kleine in that patch. Previously, yaml2obj tool always created a .symtab section. This patch changes that. With it we only create it when have a "Symbols:" tag in the YAML document or when we need to create it because it is used by another section(s). obj2yaml follows the new behavior and does not print "Symbols:" anymore when there is no symbol table. Differential revision: https://reviews.llvm.org/D69041 llvm-svn: 375361
* Move endian constant from Host.h to SwapByteOrder.h, prune includeReid Kleckner2019-10-191-0/+1
| | | | | | | | | | | | | | Works on this dependency chain: ArrayRef.h -> Hashing.h -> --CUT-- Host.h -> StringMap.h / StringRef.h ArrayRef is very popular, but Host.h is rarely needed. Move the IsBigEndianHost constant to SwapByteOrder.h. Clients of that header are more likely to need it. llvm-svn: 375316
* Prune two MachineInstr.h includes, fix up depsReid Kleckner2019-10-191-0/+1
| | | | | | | | | | MachineInstr.h included AliasAnalysis.h, which includes a world of IR constructs mostly unneeded in CodeGen. Prune it. Same for DebugInfoMetadata.h. Noticed with -ftime-trace. llvm-svn: 375311
* [WebAssembly] Allow multivalue signatures in object filesThomas Lively2019-10-181-5/+2
| | | | | | | | | | | | | | | | | Summary: Also changes the wasm YAML format to reflect the possibility of having multiple return types and to put the returns after the params for consistency with the binary encoding. Reviewers: aheejin, sbc100 Subscribers: dschuff, jgravelle-google, hiraditya, sunfish, arphaman, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69156 llvm-svn: 375283
* Fix MSVC "not all control paths return a value" warning. NFCI.Simon Pilgrim2019-10-181-0/+1
| | | | llvm-svn: 375214
* Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warnings. ↵Simon Pilgrim2019-10-181-1/+1
| | | | | | NFCI. llvm-svn: 375213
* Reland [llvm-objdump] Use a counter for llvm-objdump -h instead of the ↵Jordan Rupprecht2019-10-172-13/+54
| | | | | | | | | | | | | | | | | | | | | | | | section index. This relands r374931 (reverted in r375088). It fixes 32-bit builds by using the right format string specifier for uint64_t (PRIu64) instead of `%d`. Original description: When listing the index in `llvm-objdump -h`, use a zero-based counter instead of the actual section index (e.g. shdr->sh_index for ELF). While this is effectively a noop for now (except one unit test for XCOFF), the index values will change in a future patch that filters certain sections out (e.g. symbol tables). See D68669 for more context. Note: the test case in `test/tools/llvm-objdump/X86/section-index.s` already covers the case of incrementing the section index counter when sections are skipped. Reviewers: grimar, jhenderson, espindola Reviewed By: grimar Subscribers: emaste, sbc100, arichardson, aheejin, arphaman, seiya, llvm-commits, MaskRay Tags: #llvm Differential Revision: https://reviews.llvm.org/D68848 llvm-svn: 375178
* [llvm-objcopy] Add support for shell wildcardsJordan Rupprecht2019-10-174-49/+179
| | | | | | | | | | | | | | | | | | | | Summary: GNU objcopy accepts the --wildcard flag to allow wildcard matching on symbol-related flags. (Note: it's implicitly true for section flags). The basic syntax is to allow *, ?, \, and [] which work similarly to how they work in a shell. Additionally, starting a wildcard with ! causes that wildcard to prevent it from matching a flag. Use an updated GlobPattern in libSupport to handle these patterns. It does not fully match the `fnmatch` used by GNU objcopy since named character classes (e.g. `[[:digit:]]`) are not supported, but this should support most existing use cases (mostly just `*` is what's used anyway). Reviewers: jhenderson, MaskRay, evgeny777, espindola, alexshap Reviewed By: MaskRay Subscribers: nickdesaulniers, emaste, arichardson, hiraditya, jakehehrlich, abrachet, seiya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66613 llvm-svn: 375169
* [llvm-ar] Implement the O modifier: display member offsets inside the archiveFangrui Song2019-10-171-12/+22
| | | | | | | | | | | | Since GNU ar 2.31, the 't' operation prints member offsets beside file names if the 'O' modifier is specified. 'O' is ignored for thin archives. Reviewed By: gbreynoo, ruiu Differential Revision: https://reviews.llvm.org/D69087 llvm-svn: 375106
* [llvm-objcopy] --add-symbol: fix crash if SHT_SYMTAB does not existFangrui Song2019-10-173-20/+41
| | | | | | | | | | | | | | | | | | Exposed by D69041. If SHT_SYMTAB does not exist, ELFObjcopy.cpp:handleArgs will crash due to a null pointer dereference. for (const NewSymbolInfo &SI : Config.ELF->SymbolsToAdd) { ... Obj.SymbolTable->addSymbol( Fix this by creating .symtab and .strtab on demand in ELFBuilder<ELFT>::readSections, if --add-symbol is specified. Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D69093 llvm-svn: 375105
* [llvm-readobj] - Refine the LLVM-style output to be consistent.George Rimar2019-10-172-4/+4
| | | | | | | | | | | | | | Our LLVM-style output was inconsistent. This patch changes the output in the following way: SHT_GNU_verdef { -> VersionDefinitions [ SHT_GNU_verneed { -> VersionRequirements [ Version symbols [ -> VersionSymbols [ EH_FRAME Header [ -> EHFrameHeader { Differential revision: https://reviews.llvm.org/D68636 llvm-svn: 375095
* Revert r374931 "[llvm-objdump] Use a counter for llvm-objdump -h instead of ↵Hans Wennborg2019-10-172-54/+13
| | | | | | | | | | | | | | | | | | | | | | | | the section index." This broke llvm-objdump in 32-bit builds, see e.g. http://lab.llvm.org:8011/builders/clang-cmake-armv7-quick/builds/10925 > Summary: > When listing the index in `llvm-objdump -h`, use a zero-based counter instead of the actual section index (e.g. shdr->sh_index for ELF). > > While this is effectively a noop for now (except one unit test for XCOFF), the index values will change in a future patch that filters certain sections out (e.g. symbol tables). See D68669 for more context. Note: the test case in `test/tools/llvm-objdump/X86/section-index.s` already covers the case of incrementing the section index counter when sections are skipped. > > Reviewers: grimar, jhenderson, espindola > > Reviewed By: grimar > > Subscribers: emaste, sbc100, arichardson, aheejin, arphaman, seiya, llvm-commits, MaskRay > > Tags: #llvm > > Differential Revision: https://reviews.llvm.org/D68848 llvm-svn: 375088
* [llvm-ar] Simplify and make two global variables static. NFCFangrui Song2019-10-171-10/+4
| | | | llvm-svn: 375082
* [dsymutil] Print warning/error for unknown/missing arguments.Jonas Devlieghere2019-10-161-0/+10
| | | | | | | | | After changing dsymutil to use libOption, we lost error reporting for missing required arguments (input files). Additionally, we stopped complaining about unknown arguments. This patch fixes both and adds a test. llvm-svn: 375044
* [llvm-ar] Implement the V modifier as an alias for --versionJordan Rupprecht2019-10-161-1/+9
| | | | | | | | | | | | | | Summary: Also update the help modifier (h) so that it works as a modifier and not just as a standalone `h`. For example, `llvm-ar h` prints the help message, but `llvm-ar xh` currently prints `unknown option h`. Reviewers: MaskRay, gbreynoo Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69007 llvm-svn: 375028
* [llvm-ar] Make paths case insensitive when on windowsOwen Reynolds2019-10-161-8/+29
| | | | | | | | | When on windows gnu-ar treats member names as case insensitive. This commit implements the same behaviour. Differential Revision: https://reviews.llvm.org/D68033 llvm-svn: 375002
* [dsymutil] Support and relocate base address selection entries for debug_locJonas Devlieghere2019-10-151-0/+12
| | | | | | | | | | | | | | | Since r374600 clang emits base address selection entries. Currently dsymutil does not support these entries and incorrectly interprets them as location list entries. This patch adds support for base address selection entries in dsymutil and makes sure they are relocated correctly. Thanks to Dave for coming up with the test case! Differential revision: https://reviews.llvm.org/D69005 llvm-svn: 374957
* [XCOFF]implement parsing relocation information for 32-bit xcoff object fileDigger Lin2019-10-151-1/+53
| | | | | | | | | | | | | | Summary: Parsing the relocation entry information for 32-bit xcoff object file including deal with the relocation overflow. Reviewers: hubert.reinterpretcast, jasonliu, sfertile, xingxue. Subscribers: hiraditya, rupprecht, seiya Differential Revision: https://reviews.llvm.org/D67008 llvm-svn: 374946
* [llvm-lipo] Add missing castAlexander Shaposhnikov2019-10-151-1/+2
| | | | | | | | Add missing cast (to correctly sum 32-bit integers). Test plan: make check-all llvm-svn: 374945
* [llvm-readobj][xcoff] implement parsing overflow section header.Digger Lin2019-10-151-20/+60
| | | | | | | | | | | | | | | SUMMARY: in the xcoff, if the number of relocation entries or line number entries is overflow(large than or equal 65535) , there will be overflow section for it. The interpret of overflow section is different with generic section header, the patch implement parsing the overflow section. Reviewers: hubert.reinterpretcast,sfertile,jasonliu Subscribers: rupprecht, seiya Differential Revision: https://reviews.llvm.org/D68575 llvm-svn: 374941
* [WebAssembly] Allow multivalue types in block signature operandsThomas Lively2019-10-153-18/+11
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Renames `ExprType` to the more apt `BlockType` and adds a variant for multivalue blocks. Currently non-void blocks are only generated at the end of functions where the block return type needs to agree with the function return type, and that remains true for multivalue blocks. That invariant means that the actual signature does not need to be stored in the block signature `MachineOperand` because it can be inferred by `WebAssemblyMCInstLower` from the return type of the parent function. `WebAssemblyMCInstLower` continues to lower block signature operands to immediates when possible but lowers multivalue signatures to function type symbols. The AsmParser and Disassembler are updated to handle multivalue block types as well. Reviewers: aheejin, dschuff, aardappel Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68889 llvm-svn: 374933
* [llvm-objdump] Use a counter for llvm-objdump -h instead of the section index.Jordan Rupprecht2019-10-152-13/+54
| | | | | | | | | | | | | | | | | | | Summary: When listing the index in `llvm-objdump -h`, use a zero-based counter instead of the actual section index (e.g. shdr->sh_index for ELF). While this is effectively a noop for now (except one unit test for XCOFF), the index values will change in a future patch that filters certain sections out (e.g. symbol tables). See D68669 for more context. Note: the test case in `test/tools/llvm-objdump/X86/section-index.s` already covers the case of incrementing the section index counter when sections are skipped. Reviewers: grimar, jhenderson, espindola Reviewed By: grimar Subscribers: emaste, sbc100, arichardson, aheejin, arphaman, seiya, llvm-commits, MaskRay Tags: #llvm Differential Revision: https://reviews.llvm.org/D68848 llvm-svn: 374931
OpenPOWER on IntegriCloud