summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h
Commit message (Collapse)AuthorAge
* [RuntimeDyld] Adds the necessary hooks to MCJIT to be able to debug generatedLang Hames2014-06-25
| | | | | | | | | | MachO files using the GDB JIT debugging interface. Patch by Keno Fischer. Thanks Keno! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211652 91177308-0d34-0410-b5e6-96231b3b80d8
* AArch64/ARM64: move ARM64 into AArch64's placeTim Northover2014-05-24
| | | | | | | | | | | | | | | This commit starts with a "git mv ARM64 AArch64" and continues out from there, renaming the C++ classes, intrinsics, and other target-local objects for consistency. "ARM64" test directories are also moved, and tests that began their life in ARM64 use an arm64 triple, those from AArch64 use an aarch64 triple. Both should be equivalent though. This finishes the AArch64 merge, and everyone should feel free to continue committing as normal now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209577 91177308-0d34-0410-b5e6-96231b3b80d8
* [RuntimeDyld] Remove relocation bounds check introduced in r208375 (MachO only).Lang Hames2014-05-23
| | | | | | | | | | | | | | | | | | | | | We do all of our address arithmetic in 64-bit, and operations involving logically negative 32-bit offsets (actually represented as unsigned 64 bit ints) often overflow into higher bits. The overflow check could be preserved by casting to uint32 at the callsite for applyRelocationValue, but this would eliminate the value of the check. The right way to handle overflow in relocations is to make relocation processing target specific, and compute the values for RelocationEntry objects in the appropriate types (32-bit for 32-bit targets, 64-bit for 64-bit targets). This is coming as part of the cleanup I'm working on. This fixes another i386 regression test. <rdar://problem/16889891> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209536 91177308-0d34-0410-b5e6-96231b3b80d8
* [RuntimeDyld] Teach RuntimeDyldMachO how to handle scattered VANILLA relocs onLang Hames2014-05-22
| | | | | | | | | | | | | | | | | | | | | | i386. This fixes two more MCJIT regression tests on i386: ExecutionEngine/MCJIT/2003-05-06-LivenessClobber.ll ExecutionEngine/MCJIT/2013-04-04-RelocAddend.ll The implementation of processScatteredVANILLA is tasteless (*ba-dum-ching*), but I'm working on a substantial tidy-up of RuntimeDyldMachO that should improve things. This patch also fixes a type-o in RuntimeDyldMachO::processSECTDIFFRelocation, and teaches that method to skip over the PAIR reloc following the SECTDIFF. <rdar://problem/16961886> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209478 91177308-0d34-0410-b5e6-96231b3b80d8
* [RuntimeDyld] Add support for MachO __jump_table and __pointers sections, andLang Hames2014-05-12
| | | | | | | | | | | | | SECTDIFF relocations on 32-bit x86. This fixes several of the MCJIT regression test failures that show up on 32-bit builds. <rdar://problem/16886294> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208635 91177308-0d34-0410-b5e6-96231b3b80d8
* [RuntimeDyld] Unify the RuntimeDyldMachO resolve.*Relocation method signaturesLang Hames2014-05-09
| | | | | | | | | | | around RelocationEntries, rather than passing the same information via loose arguments. No functional change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208375 91177308-0d34-0410-b5e6-96231b3b80d8
* PR19553: Memory leak in RuntimeDyldELF::createObjectImageFromFileDavid Blaikie2014-04-29
| | | | | | | | | | | | | | | | This starts in MCJIT::getSymbolAddress where the unique_ptr<object::Binary> is release()d and (after a cast) passed to a single caller, MCJIT::addObjectFile. addObjectFile calls RuntimeDyld::loadObject. RuntimeDld::loadObject calls RuntimeDyldELF::createObjectFromFile And the pointer is never owned at this point. I say this point, because the alternative codepath, RuntimeDyldMachO::createObjectFile certainly does take ownership, so this seemed like a good hint that this was a/the right place to take ownership. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207580 91177308-0d34-0410-b5e6-96231b3b80d8
* ARM64: initial backend importTim Northover2014-03-29
| | | | | | | | | | | | This adds a second implementation of the AArch64 architecture to LLVM, accessible in parallel via the "arm64" triple. The plan over the coming weeks & months is to merge the two into a single backend, during which time thorough code review should naturally occur. Everything will be easier with the target in-tree though, hence this commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205090 91177308-0d34-0410-b5e6-96231b3b80d8
* [RuntimeDyld] clang-format files.Juergen Ributzka2014-03-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204507 91177308-0d34-0410-b5e6-96231b3b80d8
* [RuntimeDyld] Allow processRelocationRef to process more than one relocation ↵Juergen Ributzka2014-03-21
| | | | | | | | | | | | | entry at a time. Some targets require more than one relocation entry to perform a relocation. This change allows processRelocationRef to process more than one relocation entry at a time by passing the relocation iterator itself instead of just the relocation entry. Related to <rdar://problem/16199095> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204439 91177308-0d34-0410-b5e6-96231b3b80d8
* Make createObjectImage and createObjectImageFromFile static methods on theLang Hames2014-03-08
| | | | | | | | | | relevant subclasses of RuntimeDyldImpl. This allows construction of RuntimeDyldImpl instances to be deferred until after the target architecture is known. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203352 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-08
| | | | | | class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203344 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-apply r196639: Add support for archives and object file caching under MCJIT.Lang Hames2014-01-08
| | | | | | | | | | I believe the bot failures on linux systems were due to overestimating the alignment of object-files within archives, which are only guaranteed to be two-byte aligned. I have reduced the alignment in RuntimeDyldELF::createObjectImageFromFile accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198737 91177308-0d34-0410-b5e6-96231b3b80d8
* Whitespace cleanups.NAKAMURA Takumi2013-12-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196654 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r196639 while I investigate a bot failure.Lang Hames2013-12-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196641 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for archives and object file caching under MCJIT.Lang Hames2013-12-07
| | | | | | | | Patch by Andy Kaylor, with minor edits to resolve merge conflicts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196639 91177308-0d34-0410-b5e6-96231b3b80d8
* Separating ELF and MachO stub info functions for RuntimeDyldAndrew Kaylor2013-10-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192737 91177308-0d34-0410-b5e6-96231b3b80d8
* Adding multiple object support to MCJIT EH frame handlingAndrew Kaylor2013-10-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192504 91177308-0d34-0410-b5e6-96231b3b80d8
* Add EH support to the MCJIT.Rafael Espindola2013-05-05
| | | | | | | | | This gets exception handling working on ELF and Macho (x86-64 at least). Other than the EH frame registration, this patch also implements support for GOT relocations which are used to locate the personality function on MachO. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181167 91177308-0d34-0410-b5e6-96231b3b80d8
* Rationalize what is public in RuntimeDyldMachO and RuntimeDyldELF.Rafael Espindola2013-04-29
| | | | | | | | The implemented RuntimeDyldImpl interface is public. Everything else is private. Since these classes are not inherited from (yet), there is no need to have protected members. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180733 91177308-0d34-0410-b5e6-96231b3b80d8
* Use a RelocationRef instead of a relocation_iterator.Rafael Espindola2013-04-29
| | | | | | No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180723 91177308-0d34-0410-b5e6-96231b3b80d8
* Propagate relocation info to resolveRelocation.Rafael Espindola2013-04-29
| | | | | | This gets most of the MCJITs tests passing with MachO. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180716 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace ObjRelocationInfo with relocation_iterator.Rafael Espindola2013-04-29
| | | | | | | | | | | For MachO we need information that is not represented in ObjRelocationInfo. Instead of copying the bits we think are needed from a relocation_iterator, just pass the relocation_iterator down to the format specific functions. No functionality change yet as we still drop the information once processRelocationRef returns. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180711 91177308-0d34-0410-b5e6-96231b3b80d8
* Use llvm/Object/MachO.h in macho-dumper. Drop the old macho parser.Rafael Espindola2013-04-26
| | | | | | | | | | | | | | | | | | | | | For Mach-O there were 2 implementations for parsing object files. A standalone llvm/Object/MachOObject.h and llvm/Object/MachO.h which implements the generic interface in llvm/Object/ObjectFile.h. This patch adds the missing features to MachO.h, moves macho-dump to use MachO.h and removes ObjectFile.h. In addition to making sure that check-all is clean, I checked that the new version produces exactly the same output in all Mach-O files in a llvm+clang build directory (including executables and shared libraries). To test the performance, I ran macho-dump over all the files in a llvm+clang build directory again, but this time redirecting the output to /dev/null. Both the old and new versions take about 4.6 seconds (2.5 user) to finish. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180624 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort includes for all of the .h files under the 'lib' tree. These wereChandler Carruth2012-12-04
| | | | | | | | | | missed in the first pass because the script didn't yet handle include guards. Note that the script is now able to handle all of these headers without manual edits. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169224 91177308-0d34-0410-b5e6-96231b3b80d8
* Change resolveRelocation parameters so the relocations can find placeholder ↵Andrew Kaylor2012-11-02
| | | | | | | | values in the original object buffer. Some ELF relocations require adding the a value to the original contents of the object buffer at the specified location. In order to properly handle multiple applications of a relocation, the RuntimeDyld code should be grabbing the original value from the object buffer and writing a new value into the loaded section buffer. This patch changes the parameters passed to resolveRelocations to accommodate this need. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167304 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean-up of memory buffer and object ownership model in MCJITAndrew Kaylor2012-10-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165053 91177308-0d34-0410-b5e6-96231b3b80d8
* RuntimeDyld code cleanup:Eli Bendersky2012-05-01
| | | | | | | | | | | - There's no point having a different type for the local and global symbol tables. - Renamed SymbolTable to GlobalSymbolTable to clarify the intention - Improved const correctness where relevant git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155898 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement GDB integration for source level debugging of code JITed usingPreston Gurd2012-04-16
| | | | | | | | | | | | | | | | the MCJIT execution engine. The GDB JIT debugging integration support works by registering a loaded object image with a pre-defined function that GDB will monitor if GDB is attached. GDB integration support is implemented for ELF only at this time. This integration requires GDB version 7.0 or newer. Patch by Andy Kaylor! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154868 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-factored RuntimeDyLd:Danil Malyshev2012-03-30
| | | | | | | | | | | | | | | 1. The main works will made in the RuntimeDyLdImpl with uses the ObjectFile class. RuntimeDyLdMachO and RuntimeDyLdELF now only parses relocations and resolve it. This is allows to make improvements of the RuntimeDyLd more easily. In addition the support for COFF can be easily added. 2. Added ARM relocations to RuntimeDyLdELF. 3. Added support for stub functions for the ARM, allowing to do a long branch. 4. Added support for external functions that are not loaded from the object files, but can be loaded from external libraries. Now MCJIT can correctly execute the code containing the printf, putc, and etc. 5. The sections emitted instead functions, thanks Jim Grosbach. MemoryManager.startFunctionBody() and MemoryManager.endFunctionBody() have been removed. 6. MCJITMemoryManager.allocateDataSection() and MCJITMemoryManager. allocateCodeSection() used JMM->allocateSpace() instead of JMM->allocateCodeSection() and JMM->allocateDataSection(), because I got an error: "Cannot allocate an allocated block!" with object file contains more than one code or data sections. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153754 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r153694. It was causing failures in the buildbots.Bill Wendling2012-03-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153701 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-factored RuntimeDyld.Danil Malyshev2012-03-29
| | | | | | Added ExecutionEngine/MCJIT tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153694 91177308-0d34-0410-b5e6-96231b3b80d8
* Made RuntimeDyldMachO support vanilla i386Sean Callanan2012-03-26
| | | | | | | | | | relocations. The algorithm is the same as that for x86_64. Scattered relocations, a feature present in i386 but not on x86_64, are not yet supported. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153466 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert a series of commits to MCJIT to get the build working in CMakeChandler Carruth2012-03-22
| | | | | | | | | | | | | | | (and hopefully on Windows). The bots have been down most of the day because of this, and it's not clear to me what all will be required to fix it. The commits started with r153205, then r153207, r153208, and r153221. The first commit seems to be the real culprit, but I couldn't revert a smaller number of patches. When resubmitting, r153207 and r153208 should be folded into r153205, they were simple build fixes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153241 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-factored RuntimeDyld.Danil Malyshev2012-03-21
| | | | | | Added ExecutionEngine/MCJIT tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153221 91177308-0d34-0410-b5e6-96231b3b80d8
* RuntimeDyldMachO has the ability to keep track ofSean Callanan2012-03-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | relocations (i.e., pieces of data whose addresses are referred to elsewhere in the binary image) and update the references when the section containing the relocations moves. The way this works is that there is a map from section IDs to lists of relocations. Because the relocations are associated with the section containing the data being referred to, they are updated only when the target moves. However, many data references are relative and also depend on the location of the referrer. To solve this problem, I introduced a new data structure, Referrer, which simply contains the section being referred to and the index of the relocation in that section. These referrers are associated with the source containing the reference that needs to be updated, so now regardless of which end of the relocation moves, the relocation will now be updated correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153147 91177308-0d34-0410-b5e6-96231b3b80d8
* Improved support in RuntimeDyldMachO for generatingSean Callanan2012-03-07
| | | | | | | | | | | | code that will be relocated into another memory space. Now when relocations are resolved, the address of the relocation in the host memory (where the JIT is) is passed separately from the address that the relocation will be at in the target memory (where the code will run). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152264 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove duplicate code in this header file which seemed to undergo a ↵Ahmed Charles2012-02-13
| | | | | | copy/paste fiasco. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150369 91177308-0d34-0410-b5e6-96231b3b80d8
* Split the lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h header to ↵Eli Bendersky2012-01-22
smaller logical headers. ELF and MachO implementations of RuntimeDyldImpl go into their own header files now. Reviewed on llvm-commits git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148652 91177308-0d34-0410-b5e6-96231b3b80d8