summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/RuntimeDyld
Commit message (Collapse)AuthorAgeFilesLines
...
* Pass an ArrayRef to MCDisassembler::getInstruction.Rafael Espindola2014-11-121-1/+2
| | | | | | | | | | | | With this patch MCDisassembler::getInstruction takes an ArrayRef<uint8_t> instead of a MemoryObject. Even on X86 there is a maximum size an instruction can have. Given that, it seems way simpler and more efficient to just pass an ArrayRef to the disassembler instead of a MemoryObject and have it do a virtual call every time it wants some extra bytes. llvm-svn: 221751
* [JIT] Fix more missing endian conversions (opcodes for AArch64, ARM, and ↵Daniel Sanders2014-11-062-31/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | Mips stub functions, and ARM target in general) Summary: Fixed all of the missing endian conversions that Lang Hames and I identified in RuntimeDyldMachOARM.h. Fixed the opcode emission in RuntimeDyldImpl::createStubFunction() for AArch64, ARM, Mips when the host endian doesn't match the target endian. PowerPC will need changing if it's opcodes are affected by endianness but I've left this for now since I'm unsure if this is the case and it's the only path that specifies the target endian. This patch fixes MachO_ARM_PIC_relocations.s on a big-endian Mips host. This is the last of the known issues on this host. Reviewers: lhames Reviewed By: lhames Subscribers: aemerson, llvm-commits Differential Revision: http://reviews.llvm.org/D6130 llvm-svn: 221446
* [JIT] Fix some more missing endian conversions in RuntimeDyldDaniel Sanders2014-11-011-6/+7
| | | | | | | | | | | | | | Summary: This fixes MachO_i386_eh_frame.s on a big-endian Mips host. Reviewers: lhames Reviewed By: lhames Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6019 llvm-svn: 221047
* [MCJIT] Defer application of AArch64 MachO GOT relocations until resolve time.Lang Hames2014-10-211-5/+5
| | | | | | | | | | On AArch64, GOT references are page relative (ADRP + LDR), so they can't be applied until we know exactly where, within a page, the GOT entry will be in the target address space. Fixes <rdar://problem/18693976>. llvm-svn: 220347
* [MCJIT] Temporarily revert r220245 - it broke several bots.Lang Hames2014-10-211-5/+1
| | | | | | (See e.g. http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/17653) llvm-svn: 220249
* [MCJIT] Make MCJIT honor symbol visibility settings when populating the globalLang Hames2014-10-201-1/+5
| | | | | | | | symbol table. Patch by Anthony Pesch. Thanks Anthony! llvm-svn: 220245
* [MCJIT] Replace memcpy with readBytesUnaligned in RuntimeDyldMachOI386.Lang Hames2014-10-101-4/+2
| | | | | | | This should fix the failures of the MachO_i386_DynNoPIC_relocations.s test case on MIPS hosts. llvm-svn: 219543
* Remove bogus std::error_code returns form SectionRef.Rafael Espindola2014-10-085-62/+30
| | | | | | | | | | | | | | There are two methods in SectionRef that can fail: * getName: The index into the string table can be invalid. * getContents: The section might point to invalid contents. Every other method will always succeed and returning and std::error_code just complicates the code. For example, a section can have an invalid alignment, but if we are able to get to the section structure at all and create a SectionRef, we will always be able to read that invalid alignment. llvm-svn: 219314
* Fix indentation.Rafael Espindola2014-10-081-4/+4
| | | | llvm-svn: 219312
* [MCJIT] Don't crash in debugging output for sections that aren't emitted.Lang Hames2014-10-011-0/+5
| | | | llvm-svn: 218836
* [MCJIT] Fix some more RuntimeDyld debugging output format specifiers.Lang Hames2014-09-231-3/+3
| | | | llvm-svn: 218328
* Converting the JITDebugLock mutex to a ManagedStatic to avoid the static ↵Chris Bieneman2014-09-191-4/+4
| | | | | | constructor and destructor. llvm-svn: 218154
* [MCJIT] Fix a debugging-output formatting bug in RuntimeDyld.Lang Hames2014-09-181-1/+1
| | | | | | | The mismatched mask (7 vs (ColsPerRow-1)) could lead to partial lines being printed out of place. llvm-svn: 218061
* [MCJIT] Improve the "stub not found" diagnostic in RuntimeDyldChecker.Lang Hames2014-09-111-1/+4
| | | | | | | | | | | | | A "stub found found" diagnostic is emitted when RuntimeDyldChecker's stub lookup logic fails to find the requested stub. The obvious reason for the failure is that no such stub has been created, but it can also fail for internal symbols if the symbol offset is not computed correctly (E.g. due to a mangled relocation addend). This patch adds a comment about the latter case so that it's not overlooked. Inspired by confusion experienced during test case construction for r217635. llvm-svn: 217643
* [MCJIT] Add support for ARM HALF_DIFF relocations to MCJIT.Lang Hames2014-09-114-58/+183
| | | | | | Fixes <rdar://problem/18297804>. llvm-svn: 217620
* [MCJIT] Take the relocation addend into account when applying ARM MachO VANILLALang Hames2014-09-111-1/+2
| | | | | | | | and BR24 relocations. <rdar://problem/18296496> llvm-svn: 217605
* [MCJIT] Remove redundant architecture check from RuntimeDyldMachOI386.Lang Hames2014-09-101-1/+1
| | | | llvm-svn: 217470
* [MCJIT] Revert partial RuntimeDyldELF cleanup that was prematurely committed inLang Hames2014-09-071-3/+3
| | | | | | r217328. llvm-svn: 217329
* [MCJIT] Rewrite RuntimeDyldMachO and its derived classes to use the 'Offset'Lang Hames2014-09-077-18/+18
| | | | | | | | | | field of RelocationValueRef, rather than the 'Addend' field. This is consistent with RuntimeDyldELF's use of RelocationValueRef, and more consistent with the semantics of the data being stored (the offset from the start of a section or symbol). llvm-svn: 217328
* [MCJIT] Fix a bug RuntimeDyldImpl's read/writeBytesUnaligned methods.Lang Hames2014-09-071-19/+17
| | | | | | | | | The previous implementation was writing to the high-bytes of integers on BE targets (when run on LE hosts). http://llvm.org/PR20640 llvm-svn: 217325
* [MCJIT] Const-ify the symbol lookup operations on RuntimeDyld.Lang Hames2014-09-052-6/+6
| | | | llvm-svn: 217263
* unique_ptrify RuntimeDyld::DyldDavid Blaikie2014-09-041-7/+7
| | | | llvm-svn: 217180
* [MCJIT] Make sure eh-frame fixups use the target's pointer type, not the host's.Lang Hames2014-09-046-39/+63
| | | | | | | If the wrong pointer type is used it can cause corruption of the frame description entries. llvm-svn: 217124
* [MCJIT] Add command-line argument to llvm-rtdyld to specify target addresses forLang Hames2014-09-043-0/+19
| | | | | | | | | sections. This allows fine-grained control of the memory layout of hypothetical target processes for testing purposes. llvm-svn: 217122
* unique_ptrify RuntimeDyldImpl::loadObjectDavid Blaikie2014-09-032-8/+7
| | | | | | | | | | I'm not sure this is a particularly helpful API (to pass ownership and then return it unconditionally) rather than just pass the underlying object by non-const reference, but this was the original API so I'll just make it more safe/stable and anyone else is free to adjust that at their whim, of course. llvm-svn: 217081
* unique_ptrify a bunch of stuff through RuntimeDyld::loadObjectDavid Blaikie2014-09-035-38/+45
| | | | llvm-svn: 217065
* Add override to overriden virtual methods, remove virtual keywords.Benjamin Kramer2014-09-035-5/+6
| | | | | | No functionality change. Changes made by clang-tidy + some manual cleanup. llvm-svn: 217028
* [MCJIT] Make llvm-rtdyld process eh_frame sections in -verify mode (accidentallyLang Hames2014-09-031-1/+0
| | | | | | | | left out of r217010). Also remove a crufty debugging output statement that was accidentally left in. llvm-svn: 217011
* [MCJIT] Add a 'section_addr' builtin function to RuntimeDyldChecker.Lang Hames2014-09-033-25/+141
| | | | | | | | | | The syntax of the new builtin is 'section_addr(<filename>, <section-name>)' (similar to the stub_addr builtin, but without a symbol name). It returns the base address of the given section in the given object file. This builtin makes it possible to refer to the contents of sections that cannot contain symbols, e.g. sections added by the linker itself, like __eh_frame. llvm-svn: 217010
* [MCJIT] Move endian-aware read/writes from RuntimeDyldMachO intoLang Hames2014-08-298-57/+46
| | | | | | | | | RuntimeDyldImpl. These are platform independent, and moving them to the base class allows RuntimeDyldChecker to use them too. llvm-svn: 216801
* [MCJIT] Fix format specifiers for debug output in RuntimeDyld.Lang Hames2014-08-282-3/+3
| | | | | | More work on http://llvm.org/PR20640 llvm-svn: 216648
* Fix unaligned reads/writes in X86JIT and RuntimeDyldELF.Alexey Samsonov2014-08-271-26/+22
| | | | | | | | | | | | | | | | Summary: Introduce support::ulittleX_t::ref type to Support/Endian.h and use it in x86 JIT to enforce correct endianness and fix unaligned accesses. Test Plan: regression test suite Reviewers: lhames Subscribers: ributzka, llvm-commits Differential Revision: http://reviews.llvm.org/D5011 llvm-svn: 216631
* [MCJIT] Replace a C-style cast in RuntimeDyldImpl.h.Lang Hames2014-08-271-1/+1
| | | | llvm-svn: 216568
* [MCJIT] More endianness fixes for RuntimeDyldMachO.Lang Hames2014-08-272-12/+28
| | | | | | http://llvm.org/PR20640 llvm-svn: 216567
* Silence unused function warning in Release builds.Benjamin Kramer2014-08-261-0/+2
| | | | llvm-svn: 216458
* [MCJIT][SystemZ] Use a simpler expression for indirect relocation offsets.Lang Hames2014-08-251-1/+1
| | | | | | | | The expressions 'Reloc.Addend - Addend' and 'Reloc.Offset' should always be equal in this context. The latter is prefered - we want to remove the RelocationValueRef::Addend field in the future. llvm-svn: 216418
* [MCJIT] Dump section memory both before and after relocations are applied.Lang Hames2014-08-251-5/+8
| | | | | | Also switch section memory dump format from 8 to 16 columns. llvm-svn: 216413
* [MCJIT] Make RuntimeDyld dump section contents in -debug mode.Lang Hames2014-08-252-4/+34
| | | | llvm-svn: 216400
* [MCJIT] Allow '$' characters in symbol names in RuntimeDyldChecker.Lang Hames2014-08-191-1/+1
| | | | llvm-svn: 216017
* Don't own the buffer in object::Binary.Rafael Espindola2014-08-192-22/+19
| | | | | | | | | | | | | | | | | | | | | | | | | Owning the buffer is somewhat inflexible. Some Binaries have sub Binaries (like Archive) and we had to create dummy buffers just to handle that. It is also a bad fit for IRObjectFile where the Module wants to own the buffer too. Keeping this ownership would make supporting IR inside native objects particularly painful. This patch focuses in lib/Object. If something elsewhere used to own an Binary, now it also owns a MemoryBuffer. This patch introduces a few new types. * MemoryBufferRef. This is just a pair of StringRefs for the data and name. This is to MemoryBuffer as StringRef is to std::string. * OwningBinary. A combination of Binary and a MemoryBuffer. This is needed for convenience functions that take a filename and return both the buffer and the Binary using that buffer. The C api now uses OwningBinary to avoid any change in semantics. I will start a new thread to see if we want to change it and how. llvm-svn: 216002
* [MCJIT] Respect target endianness in RuntimeDyldMachO and RuntimeDyldChecker.Lang Hames2014-08-183-6/+22
| | | | | | This patch may address some of the issues described in http://llvm.org/PR20640. llvm-svn: 215938
* Use copy initialization to initialize std::unique_ptr.Rafael Espindola2014-08-172-2/+2
| | | | | | Thanks to David Blaikie for the suggestion. llvm-svn: 215867
* Canonicalize header guards into a common format.Benjamin Kramer2014-08-1310-27/+27
| | | | | | | | | | Add header guards to files that were missing guards. Remove #endif comments as they don't seem common in LLVM (we can easily add them back if we decide they're useful) Changes made by clang-tidy with minor tweaks. llvm-svn: 215558
* [MCJIT] Simplify immediate decoding code in the RuntimeDyldMachO hierarchy.Lang Hames2014-08-086-44/+49
| | | | | | | | | | | Cleanup only: no functional change. This patch makes RuntimeDyldMachO targets directly responsible for decoding immediates, rather than letting them implement catch a callback from generic code. Since this is a very target specific operation, it makes sense to let the target-specific code drive it. llvm-svn: 215255
* [MCJIT] Replace a c-style cast with reinterpret_cast + static_cast.Lang Hames2014-08-071-4/+4
| | | | | | | | | | C-style casts (and reinterpret_casts) result in implementation defined values when a pointer is cast to a larger integer type. On some platforms this was leading to bogus address computations in RuntimeDyldMachOAArch64. This should fix http://llvm.org/PR20501. llvm-svn: 215143
* [MCJIT] Fix an overly-aggressive check in RuntimeDyldMachOARM.Lang Hames2014-08-021-5/+0
| | | | | | | This should fix the MachO_ARM_PIC_relocations.s test failures on some 32-bit testers. llvm-svn: 214613
* Use std::unique_ptr to make the ownership explicit.Rafael Espindola2014-07-311-1/+1
| | | | llvm-svn: 214377
* [MCJIT] Fix the ARM BR24 relocation in RuntimeDyldMachO.Lang Hames2014-07-306-12/+31
| | | | | | | | | | We now (1) correctly decode the branch immediate, (2) modify the immediate to corretly treat it as PC-rel, and (3) properly populate the stub entry. Previously we had been doing each of these wrong. <rdar://problem/17750739> llvm-svn: 214285
* [MCJIT] Add options to llvm-rtdyld to describe a phony target address space forLang Hames2014-07-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | use in -verify mode. This patch adds three hidden command line options to llvm-rtdyld: -target-addr-start <start-addr> : Specify the start of the virtual address space on the phony target. -target-addr-end <end-addr> : Specify the end of the virtual address space on the phony target. -target-section-sep <sep> : Specify the separation (in bytes) between the end of one section and the start of the next. These options automatically default to sane values for the target platform. In particular, they allow narrow (e.g. 32-bit, 16-bit) targets to be tested from wider (e.g. 64-bit, 32-bit) hosts without overflowing pointers. The section separation option defaults to zero, but can be set to a large number (e.g. 1 << 32) to force large separations between sections in order to stress-test large-code-model code. llvm-svn: 214255
* [MCJIT] Make sure we print the full 64-bit result of exprs in ↵Lang Hames2014-07-291-2/+2
| | | | | | RuntimeDyldChecker. llvm-svn: 214227
OpenPOWER on IntegriCloud