summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* vs integration: Use llvm-lib for librarianRussell Gallop2019-04-293-0/+24
| | | | | | | | | | | | | | This uses llvm-lib.exe for the librarian instead of Visual Studio provided lib.exe. Without this it is not possible to create static libraries with -flto using the plugin. Original patch by Steven Noonan This fixes: PR41147 Differential Revision: https://reviews.llvm.org/D61193 llvm-svn: 359430
* [llvm-nm] Simplify and fix a buffer overflowFangrui Song2019-04-291-149/+107
| | | | | | | | | | | | | * char SymbolAddrStr[18] can't hold "%" PRIo64 which may need 22 characters. * Use range-based for * Delete unnecessary typedef * format(...).print(Str, sizeof(Str)) + outs() << Str => outs() << format(...) * Use cascading outs() << .. << .. * Use iterator_range(Container &&c) * (A & B) == B => A & B if B is a power of 2 * replace null sentinel in constants with makeArrayRef llvm-svn: 359416
* [lli] Fix a typo in a cl::opt description.Lang Hames2019-04-271-1/+1
| | | | | | | | Patch by Wasiher. Thanks Wasiher! Differential Revision: https://reviews.llvm.org/D61135 llvm-svn: 359384
* [llvm-nm][llvm-readelf] Avoid single-dash -long-option in testsFangrui Song2019-04-271-4/+0
| | | | llvm-svn: 359383
* [llvm-nm] Support section type 'u': STB_GNU_UNIQUEFangrui Song2019-04-271-0/+4
| | | | llvm-svn: 359380
* [ORC] Add a 'plugin' interface to ObjectLinkingLayer for events/configuration.Lang Hames2019-04-261-7/+21
| | | | | | | | | | | | | ObjectLinkingLayer::Plugin provides event notifications when objects are loaded, emitted, and removed. It also provides a modifyPassConfig callback that allows plugins to modify the JITLink pass configuration. This patch moves eh-frame registration into its own plugin, and teaches llvm-jitlink to only add that plugin when performing execution runs on non-Windows platforms. This should allow us to re-enable the test case that was removed in r359198. llvm-svn: 359357
* [llvm-nm] Revert inadvertently committed 'i' change in r359314Fangrui Song2019-04-261-3/+0
| | | | llvm-svn: 359315
* [ThinLTO] Fix X86/strong_non_prevailing.ll after llvm-nm 'r' changeFangrui Song2019-04-261-0/+3
| | | | llvm-svn: 359314
* [llvm-nm] Generalize symbol types 'N', 'n' and '?'Fangrui Song2019-04-261-9/+5
| | | | llvm-svn: 359312
* [llvm-nm] Fix handling of symbol types 't' 'd' 'r'Fangrui Song2019-04-261-19/+6
| | | | | | | | | | | | | | | In addition, fix and convert the two tests to yaml2obj based. This allows us to delete two executables. X86/weak.test: 'v' was not tested X86/init-fini.test: symbol types of __bss_start _edata _end were wrong GNU nm reports __init_array_start as 't', and __preinit_array_start as 'd'. __init_array_start is 't' just because its section ".init_array" starts with ".init" 'd' makes more sense and allows us to drop the weird SHT_INIT_ARRAY rule. So, change __init_array_start to 'd' instead. llvm-svn: 359311
* [yaml2obj] - Make implicitSectionNames() return std::vector<StringRef>. NFCI.George Rimar2019-04-261-4/+4
| | | | | | | No need to use SmallVector of char* here. This simplifies the code. llvm-svn: 359301
* [yaml2obj] - Remove excessive variable. NFC.George Rimar2019-04-261-3/+3
| | | | | | `auto &Strtab` was used only once. llvm-svn: 359300
* [yaml2obj] - Make the code to match the LLVM style. NFCI.George Rimar2019-04-261-7/+7
| | | | | | | This renames the variables to uppercase and removes use of `auto` for unobvious type. llvm-svn: 359298
* [yaml2elf] - Cleanup the initSectionHeaders(). NFCI.George Rimar2019-04-261-67/+74
| | | | | | | | This encapsulates the section specific code inside the corresponding writeSectionContent methods. Making the code a bit more consistent. llvm-svn: 359297
* Minor formatting tweak, no behavior changeNico Weber2019-04-261-4/+7
| | | | llvm-svn: 359295
* Fix typos: (re)?sor?uce -> (re)?sourceFangrui Song2019-04-261-1/+1
| | | | | | | | | | | Closes: https://github.com/llvm/llvm-project/pull/10 In-collaboration-with: Olivier Cochard-Labbé <olivier@FreeBSD.org> Signed-off-by: Enji Cooper <yaneurabeya@gmail.com> Differential Revision: https://reviews.llvm.org/D61021 llvm-svn: 359277
* [llvm-objcopy] Accept --long-option but not -long-optionFangrui Song2019-04-262-45/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: llvm-{objcopy,strip} (and many other LLVM binary utilities) accept cl::opt style -long-option as well as many short options (e.g. -p -S -x). People who use them as replacement of GNU binutils often use the grouped option syntax (POSIX Utility Conventions), e.g. -Sx => -S -x, -Wd => -W -d, -sj.text => -s -j.text There is ambiguity if a long option starts with the character used by a short option. Drop the support for -long-option to resolve the ambiguity. This divergence from other utilities is accepted (other utilities continue supporting -long-option). https://lists.llvm.org/pipermail/llvm-dev/2019-April/131786.html Reviewers: alexshap, jakehehrlich, jhenderson, rupprecht, espindola Reviewed By: jakehehrlich, jhenderson, rupprecht Subscribers: grimar, emaste, arichardson, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60439 llvm-svn: 359265
* [yaml2obj] - Don't crash on invalid inputs.George Rimar2019-04-251-5/+1
| | | | | | | | | | | | | | yaml2obj might crash on invalid input when unable to parse the YAML. Recently a crash with a very similar nature was fixed for an empty files. This patch revisits the fix and does it in yaml::Input instead. It seems to be more correct way to handle such situation. With that crash for invalid inputs is also fixed now. Differential revision: https://reviews.llvm.org/D61059 llvm-svn: 359178
* [llvm-rtdyld] Add support for passing command line arguments to rtdyld-run code.Lang Hames2019-04-251-5/+19
| | | | | | | | | | | | | | | | | The --args option can now be used to pass arguments to code linked with llvm-rtdyld. E.g. $ llvm-rtdyld file1.o file2.o --args a b c is equivalent to: $ ld -o program file1.o file2.o $ ./program a b c This is the rtdyld counterpart to the jitlink change in r359115, and makes benchmarking and comparison between the tools easier. llvm-svn: 359168
* Enable LoopVectorization by default.Alina Sbirlea2019-04-251-9/+7
| | | | | | | | | | | | | | | | | Summary: When refactoring vectorization flags, vectorization was disabled by default in the new pass manager. This patch re-enables is for both managers, and changes the assumptions opt makes, based on the new defaults. Comments in opt.cpp should clarify the intended use of all flags to enable/disable vectorization. Reviewers: chandlerc, jgorbe Subscribers: jlebar, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61091 llvm-svn: 359167
* [llvm-objdump] errorToErrorCode+message -> toStringFangrui Song2019-04-251-4/+3
| | | | | | For test/Object/elf-invalid-phdr.test, the intended error message got lost due to errorToErrorCode(). llvm-svn: 359166
* llvm-cvtres: Make new dupe resource error a bit friendlierNico Weber2019-04-242-26/+4
| | | | | | | | | | | | For well-known type IDs, include the name of the type. To not duplicate the ID->name map, make llvm-readobj call this new function as well. It has slightly different output, so this also requires updating a few tests. Differential Revision: https://reviews.llvm.org/D61086 llvm-svn: 359153
* llvm-cvtres: Remove a default argument. No behavior change.Nico Weber2019-04-241-1/+1
| | | | llvm-svn: 359128
* [JITLink] Add support for passing arguments to jit-linked code.Lang Hames2019-04-241-2/+13
| | | | | | | | | | | | | | The --args option can now be used to pass arguments to code linked with llvm-jitlink. E.g. $ llvm-jitlink file1.o file2.o --args a b c is equivalent to: $ ld -o program file1.o file2.o $ ./program a b c llvm-svn: 359115
* [AMDGPU] Add gfx1010 target definitionsStanislav Mekhanoshin2019-04-241-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D61041 llvm-svn: 359113
* Revert "[llvm-objdump] errorToErrorCode+message -> toString"JF Bastien2019-04-241-3/+4
| | | | | | | | Revert r359100 It breaks llvm/test/Object/elf-invalid-phdr.test llvm-svn: 359110
* [JITLink] Refer to FDE's CIE (not the most recent CIE) when parsing eh-frame.Lang Hames2019-04-241-21/+27
| | | | | | | | | | | | | | | Frame Descriptor Entries (FDEs) have a pointer back to a Common Information Entry (CIE) that describes how the rest FDE should be parsed. JITLink had been assuming that FDEs always referred to the most recent CIE encountered, but the spec allows them to point back to any previously encountered CIE. This patch fixes JITLink to look up the correct CIE for the FDE. The testcase is a MachO binary with an FDE that refers to a CIE that is not the one immediately proceeding it (the layout can be viewed wit 'dwarfdump --eh-frame <testcase>'. This test case had to be a binary as llvm-mc now sorts FDEs (as of r356216) to ensure FDEs *do* point to the most recent CIE. llvm-svn: 359105
* [llvm-objdump] Delete redundant checkFangrui Song2019-04-241-4/+1
| | | | llvm-svn: 359102
* [obj2yamp] - Simplify and cleanup the code in ELFDumper<ELFT>::dumpGroup a ↵George Rimar2019-04-241-27/+25
| | | | | | | | | | bit. NFC. This makes the variables naming to match LLVM style, simplifies the code used to extract the group members, simplifies the loop and reorders the code around a bit. llvm-svn: 359101
* [llvm-objdump] errorToErrorCode+message -> toStringFangrui Song2019-04-241-4/+3
| | | | llvm-svn: 359100
* [yaml2obj] Replace num_zeros with write_zerosFangrui Song2019-04-241-35/+24
| | | | llvm-svn: 359091
* [yaml2elf] - Replace a loop with write_zeros(). NFC.George Rimar2019-04-241-6/+5
| | | | | | And apply clang-format to the method changed. llvm-svn: 359090
* [CommandLine] Provide parser<unsigned long> instantiation to allow ↵Fangrui Song2019-04-247-44/+39
| | | | | | | | | | | | | cl::opt<uint64_t> on LP64 platforms Summary: And migrate opt<unsigned long long> to opt<uint64_t> Fixes PR19665 Differential Revision: https://reviews.llvm.org/D60933 llvm-svn: 359068
* llvm-cvtres: Accept /? as help flag, like cvtres.exeNico Weber2019-04-241-0/+1
| | | | llvm-svn: 359064
* [dsymutil] Put Swift interface files into a per-arch subdirectory.Adrian Prantl2019-04-231-1/+1
| | | | | | | | | This was meant to be part of the original commit r358921, but somehow got lost. <rdar://problem/49751748> llvm-svn: 359010
* [dsymutil] Fix use-after-free when sys::path::append grows the buffer.Adrian Prantl2019-04-231-2/+2
| | | | | | <rdar://problem/50117620> llvm-svn: 359003
* Revert "[dsymutil] Fix use-after-free when sys::path::append grows the buffer."Adrian Prantl2019-04-231-1/+1
| | | | llvm-svn: 359002
* [dsymutil] Fix use-after-free when sys::path::append grows the buffer.Adrian Prantl2019-04-231-1/+1
| | | | | | <rdar://problem/50117620> llvm-svn: 359001
* Fully qualify llvm::Optional, some compilers complain otherwise.Adrian Prantl2019-04-221-3/+4
| | | | llvm-svn: 358933
* Try to work around compile errors with older versions of GCC.Adrian Prantl2019-04-221-6/+10
| | | | llvm-svn: 358927
* [dsymutil] Collect parseable Swift interfaces in the .dSYM bundle.Adrian Prantl2019-04-226-49/+175
| | | | | | | | | | | | | | | | | | When a Swift module built with debug info imports a library without debug info from a textual interface, the textual interface is necessary to reconstruct types defined in the library's interface. By recording the Swift interface files in DWARF dsymutil can collect them and LLDB can find them. This patch teaches dsymutil to look for DW_TAG_imported_modules and records all references to parseable Swift ingterfrace files and copies them to a.out.dSYM/Contents/Resources/<Arch>/<ModuleName>.swiftinterface <rdar://problem/49751748> llvm-svn: 358921
* Use llvm::stable_sort. NFCFangrui Song2019-04-227-22/+18
| | | | llvm-svn: 358897
* Attemp get llvm-jitlink building on WindowsNico Weber2019-04-211-6/+4
| | | | | | | | By removing an include of dlfcn.h that looks unused. And clang-format a too-long line while here. llvm-svn: 358864
* [JITLink] Add an option to dump relocated section content.Lang Hames2019-04-211-3/+82
| | | | | | | | The -dump-relocated-section-content option will dump the contents of each section after relocations are applied, and before any checks are run or code executed. llvm-svn: 358863
* [JITLink] Add BinaryFormat to JITLink's dependencies.Lang Hames2019-04-202-1/+3
| | | | | | | | | Hopefully this will fix the missing dependence on llvm::identify_magic that is showing up on some PPC bots. E.g. http://lab.llvm.org:8011/builders/clang-ppc64le-linux-multistage/builds/9617 llvm-svn: 358827
* [JITLink] Add llvm-jitlink subdirectory to tools/LLVMBuild.txtLang Hames2019-04-201-0/+1
| | | | llvm-svn: 358823
* Initial implementation of JITLink - A replacement for RuntimeDyld.Lang Hames2019-04-206-1/+783
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: JITLink is a jit-linker that performs the same high-level task as RuntimeDyld: it parses relocatable object files and makes their contents runnable in a target process. JITLink aims to improve on RuntimeDyld in several ways: (1) A clear design intended to maximize code-sharing while minimizing coupling. RuntimeDyld has been developed in an ad-hoc fashion for a number of years and this had led to intermingling of code for multiple architectures (e.g. in RuntimeDyldELF::processRelocationRef) in a way that makes the code more difficult to read, reason about, extend. JITLink is designed to isolate format and architecture specific code, while still sharing generic code. (2) Support for native code models. RuntimeDyld required the use of large code models (where calls to external functions are made indirectly via registers) for many of platforms due to its restrictive model for stub generation (one "stub" per symbol). JITLink allows arbitrary mutation of the atom graph, allowing both GOT and PLT atoms to be added naturally. (3) Native support for asynchronous linking. JITLink uses asynchronous calls for symbol resolution and finalization: these callbacks are passed a continuation function that they must call to complete the linker's work. This allows for cleaner interoperation with the new concurrent ORC JIT APIs, while still being easily implementable in synchronous style if asynchrony is not needed. To maximise sharing, the design has a hierarchy of common code: (1) Generic atom-graph data structure and algorithms (e.g. dead stripping and | memory allocation) that are intended to be shared by all architectures. | + -- (2) Shared per-format code that utilizes (1), e.g. Generic MachO to | atom-graph parsing. | + -- (3) Architecture specific code that uses (1) and (2). E.g. JITLinkerMachO_x86_64, which adds x86-64 specific relocation support to (2) to build and patch up the atom graph. To support asynchronous symbol resolution and finalization, the callbacks for these operations take continuations as arguments: using JITLinkAsyncLookupContinuation = std::function<void(Expected<AsyncLookupResult> LR)>; using JITLinkAsyncLookupFunction = std::function<void(const DenseSet<StringRef> &Symbols, JITLinkAsyncLookupContinuation LookupContinuation)>; using FinalizeContinuation = std::function<void(Error)>; virtual void finalizeAsync(FinalizeContinuation OnFinalize); In addition to its headline features, JITLink also makes other improvements: - Dead stripping support: symbols that are not used (e.g. redundant ODR definitions) are discarded, and take up no memory in the target process (In contrast, RuntimeDyld supported pointer equality for weak definitions, but the redundant definitions stayed resident in memory). - Improved exception handling support. JITLink provides a much more extensive eh-frame parser than RuntimeDyld, and is able to correctly fix up many eh-frame sections that RuntimeDyld currently (silently) fails on. - More extensive validation and error handling throughout. This initial patch supports linking MachO/x86-64 only. Work on support for other architectures and formats will happen in-tree. Differential Revision: https://reviews.llvm.org/D58704 llvm-svn: 358818
* [llvm-objdump] Fix End in disassemblyObject after rL358806Fangrui Song2019-04-201-3/+3
| | | | llvm-svn: 358809
* [llvm-objdump] Don't disassemble symbols before SectionAddrFangrui Song2019-04-201-4/+6
| | | | | | | | | This was caught by UBSAN tools/llvm-objdump/X86/macho-disassembly-g-dsym.test tools/llvm-objdump/X86/hex-displacement.test llvm-svn: 358806
* [llvm-objdump] Simplify --{start,stop}-addressFangrui Song2019-04-201-23/+13
| | | | llvm-svn: 358803
OpenPOWER on IntegriCloud