summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [MCJIT] Add support for ARM HALF_DIFF relocations to MCJIT.Lang Hames2014-09-111-0/+58
| | | | | | Fixes <rdar://problem/18297804>. llvm-svn: 217620
* [MCJIT] Rewrite RuntimeDyldMachO and its derived classes to use the 'Offset'Lang Hames2014-09-071-5/+5
| | | | | | | | | | 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] Make sure eh-frame fixups use the target's pointer type, not the host's.Lang Hames2014-09-041-16/+46
| | | | | | | If the wrong pointer type is used it can cause corruption of the frame description entries. llvm-svn: 217124
* [MCJIT] Move endian-aware read/writes from RuntimeDyldMachO intoLang Hames2014-08-291-34/+2
| | | | | | | | | 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-281-2/+2
| | | | | | More work on http://llvm.org/PR20640 llvm-svn: 216648
* [MCJIT] More endianness fixes for RuntimeDyldMachO.Lang Hames2014-08-271-7/+20
| | | | | | http://llvm.org/PR20640 llvm-svn: 216567
* [MCJIT] Make RuntimeDyld dump section contents in -debug mode.Lang Hames2014-08-251-2/+2
| | | | llvm-svn: 216400
* [MCJIT] Respect target endianness in RuntimeDyldMachO and RuntimeDyldChecker.Lang Hames2014-08-181-4/+11
| | | | | | This patch may address some of the issues described in http://llvm.org/PR20640. llvm-svn: 215938
* [MCJIT] Simplify immediate decoding code in the RuntimeDyldMachO hierarchy.Lang Hames2014-08-081-2/+4
| | | | | | | | | | | 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] Fix the ARM BR24 relocation in RuntimeDyldMachO.Lang Hames2014-07-301-3/+3
| | | | | | | | | | 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
* [RuntimeDyld][AArch64] Make encode/decodeAddend more typesafe by using the ↵Juergen Ributzka2014-07-291-1/+1
| | | | | | relocation enum type. NFCI. llvm-svn: 214204
* AArch64: remove arm64 triple enumerator.Tim Northover2014-07-231-1/+1
| | | | | | | | | | | | Having both Triple::arm64 and Triple::aarch64 is extremely confusing, and invites bugs where only one is checked. In reality, the only legitimate difference between the two (arm64 usually means iOS) is also present in the OS part of the triple and that's what should be checked. We still parse the "arm64" triple, just canonicalise it to Triple::aarch64, so there aren't any LLVM-side test changes. llvm-svn: 213743
* [RuntimeDyld] Change the return type of decodeAddend to match the storage type.Juergen Ributzka2014-07-221-3/+3
| | | | llvm-svn: 213686
* Fixing an MSVC conversion warning about implicitly converting the shift ↵Aaron Ballman2014-07-211-1/+1
| | | | | | results to 64-bits. No functional change intended. llvm-svn: 213515
* [MCJIT] Add a 'decodeAddend' method to RuntimeDyldMachO and teachLang Hames2014-07-191-20/+3
| | | | | | | | | | getBasicRelocationEntry to use this rather than 'memcpy' to get the relocation addend. Targets with non-trivial addend encodings (E.g. AArch64) can override decodeAddend to handle immediates with interesting encodings. No functional change. llvm-svn: 213435
* [MCJIT] Significantly refactor the RuntimeDyldMachO class.Lang Hames2014-07-171-754/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous implementation of RuntimeDyldMachO mixed logic for all targets within a single class, creating problems for readability, maintainability, and performance. To address these issues, this patch strips the RuntimeDyldMachO class down to just target-independent functionality, and moves all target-specific functionality into target-specific subclasses RuntimeDyldMachO. The new class hierarchy is as follows: class RuntimeDyldMachO Implemented in RuntimeDyldMachO.{h,cpp} Contains logic that is completely independent of the target. This consists mostly of MachO helper utilities which the derived classes use to get their work done. template <typename Impl> class RuntimeDyldMachOCRTPBase<Impl> : public RuntimeDyldMachO Implemented in RuntimeDyldMachO.h Contains generic MachO algorithms/data structures that defer to the Impl class for target-specific behaviors. RuntimeDyldMachOARM : public RuntimeDyldMachOCRTPBase<RuntimeDyldMachOARM> RuntimeDyldMachOARM64 : public RuntimeDyldMachOCRTPBase<RuntimeDyldMachOARM64> RuntimeDyldMachOI386 : public RuntimeDyldMachOCRTPBase<RuntimeDyldMachOI386> RuntimeDyldMachOX86_64 : public RuntimeDyldMachOCRTPBase<RuntimeDyldMachOX86_64> Implemented in their respective *.h files in lib/ExecutionEngine/RuntimeDyld/MachOTargets Each of these contains the relocation logic specific to their target architecture. llvm-svn: 213293
* [RuntimeDyld] Revert r211652 - MachO object GDB registration support.Lang Hames2014-07-151-142/+14
| | | | | | | | The registration scheme used in r211652 violated the read-only contract of MemoryBuffer. This caused crashes in llvm-rtdyld where macho objects were backed by read-only mmap'd memory. llvm-svn: 213086
* [RuntimeDyld] Handle endiannes differences between the host and target whileLang Hames2014-07-141-14/+19
| | | | | | | | | | reading MachO files magic numbers in RuntimeDyld. This is required now that we're testing cross-platform JITing (via RuntimeDyldChecker), and should fix some issues that David Fang has seen on PPC builds. llvm-svn: 213012
* [RuntimeDyld] Add GOT support for AArch64 to RuntimeDyldMachO.Lang Hames2014-07-111-24/+174
| | | | | | | | Test cases to follow once RuntimeDyldChecker supports introspection of stubs. Fixes <rdar://problem/17648000> llvm-svn: 212859
* Silencing some -Wcast-qual warnings. No functional changes intended.Aaron Ballman2014-06-271-2/+2
| | | | llvm-svn: 211923
* [RuntimeDyld] Teach MachOObjectImage to deregister itself with the debugger uponLang Hames2014-06-261-1/+4
| | | | | | destruction the same way ELFObjectImage does. llvm-svn: 211815
* [RuntimeDyld] Adds the necessary hooks to MCJIT to be able to debug generatedLang Hames2014-06-251-2/+122
| | | | | | | | MachO files using the GDB JIT debugging interface. Patch by Keno Fischer. Thanks Keno! llvm-svn: 211652
* AArch64/ARM64: move ARM64 into AArch64's placeTim Northover2014-05-241-3/+4
| | | | | | | | | | | | | | | 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. llvm-svn: 209577
* [RuntimeDyld] Teach RuntimeDyldMachO how to handle scattered VANILLA relocs onLang Hames2014-05-221-9/+55
| | | | | | | | | | | | | | | | | | | | 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> llvm-svn: 209478
* [RuntimeDyld] Fix x86-64 MachO GOT relocation handling.Lang Hames2014-05-191-2/+7
| | | | | | | | | | | For GOT relocations the addend should modify the offset to the GOT entry, not the value of the entry itself. Teach RuntimeDyldMachO to do The Right Thing here. Fixes <rdar://problem/16961886>. llvm-svn: 209154
* [RuntimeDyld] Fix handling of i386 PC-rel external relocations. This fixesLang Hames2014-05-131-0/+11
| | | | | | | | several more i386 MCJIT regression test failures. <rdar://problem/16889891> llvm-svn: 208735
* [RuntimeDyld] Add support for MachO __jump_table and __pointers sections, andLang Hames2014-05-121-3/+175
| | | | | | | | | | | 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> llvm-svn: 208635
* [RuntimeDyld] Unify the RuntimeDyldMachO resolve.*Relocation method signaturesLang Hames2014-05-091-126/+101
| | | | | | | | | around RelocationEntries, rather than passing the same information via loose arguments. No functional change. llvm-svn: 208375
* [C++] Use 'nullptr'.Craig Topper2014-04-241-1/+1
| | | | llvm-svn: 207083
* [Modules] Fix potential ODR violations by sinking the DEBUG_TYPEChandler Carruth2014-04-221-1/+2
| | | | | | | definition below all the header #include lines. This updates most of the miscellaneous other lib/... directories. A few left though. llvm-svn: 206845
* ARM64: initial backend importTim Northover2014-03-291-0/+53
| | | | | | | | | | | | 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. llvm-svn: 205090
* [RuntimeDyld] clang-format files.Juergen Ributzka2014-03-211-98/+68
| | | | llvm-svn: 204507
* [RuntimeDyld] Allow processRelocationRef to process more than one relocation ↵Juergen Ributzka2014-03-211-10/+13
| | | | | | | | | | | | | 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> llvm-svn: 204439
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-061-1/+0
| | | | | | | | | | This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
* Consistently check 'IsCode' when allocating sections in RuntimeDyld (viaLang Hames2014-02-181-1/+3
| | | | | | | | | | | | | | findOrEmitSection). Vaidas Gasiunas's patch, r201259, fixed one instance where we were always allocating sections as text. This patch fixes the remaining buggy call sites. No test case: This isn't breaking anything that I know of, it's just inconsistent. <rdar://problem/15943542> llvm-svn: 201605
* Add support for PC-relative non-extern relocations to RuntimeDyldMachO.Lang Hames2014-01-291-0/+2
| | | | | | | | | Also replaces testcase for r180790 (support for absolute non-externs relocs) with a more robust version. <rdar://problem/15864721> llvm-svn: 200404
* Re-apply r196639: Add support for archives and object file caching under MCJIT.Lang Hames2014-01-081-0/+5
| | | | | | | | | 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. llvm-svn: 198737
* Whitespace cleanups.NAKAMURA Takumi2013-12-071-1/+1
| | | | llvm-svn: 196654
* Revert r196639 while I investigate a bot failure.Lang Hames2013-12-071-5/+0
| | | | llvm-svn: 196641
* Add support for archives and object file caching under MCJIT.Lang Hames2013-12-071-0/+5
| | | | | | Patch by Andy Kaylor, with minor edits to resolve merge conflicts. llvm-svn: 196639
* Adding multiple object support to MCJIT EH frame handlingAndrew Kaylor2013-10-111-25/+50
| | | | llvm-svn: 192504
* Move everything depending on Object/MachOFormat.h over to Support/MachO.h.Charles Davis2013-09-011-31/+31
| | | | llvm-svn: 189728
* Revert "Fix the build broken by r189315." and "Move everything depending on ↵Charles Davis2013-08-271-32/+32
| | | | | | | | | Object/MachOFormat.h over to Support/MachO.h." This reverts commits r189319 and r189315. r189315 broke some tests on what I believe are big-endian platforms. llvm-svn: 189321
* Move everything depending on Object/MachOFormat.h over to Support/MachO.h.Charles Davis2013-08-271-32/+32
| | | | llvm-svn: 189315
* Adding comments to document RuntimeDyld relocation handlingAndrew Kaylor2013-08-191-0/+20
| | | | llvm-svn: 188697
* Support X86_64_GOTLoad relocations in RuntimeDyldMachO by treating them theLang Hames2013-08-151-4/+4
| | | | | | | | | | | | | | | | same way as X86_64_GOT relocations. The 'Load' part of GOTLoad is just an optimization hint for the linker anyway, and can be safely ignored. This patch also fixes some minor issues with the relocations introduced while processing an X86_64_GOT[Load]: the addend for the GOT entry should always be zero, and the addend for the replacement relocation at the original offset should be the same as the addend of the relocation being replaced. I haven't come up with a good way of testing this yet, but I'm working on it. This fixes <rdar://problem/14651564>. llvm-svn: 188499
* Optimistically ignore scattered relocations in MachO in RuntimeDyld. ThisLang Hames2013-08-091-0/+10
| | | | | | | | un-breaks simple use cases while I work on more general support. <rdar://problem/14487667> llvm-svn: 188044
* Handle relocations that don't point to symbols.Rafael Espindola2013-06-051-3/+2
| | | | | | | | In ELF (as in MachO), not all relocations point to symbols. Represent this properly by using a symbol_iterator instead of a SymbolRef. Update llvm-readobj ELF's dumper to handle relocatios without symbols. llvm-svn: 183284
* Add EH support to the MCJIT.Rafael Espindola2013-05-051-1/+87
| | | | | | | | | 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. llvm-svn: 181167
* Fix Addend computation for non external relocations on Macho.Rafael Espindola2013-04-301-28/+10
| | | | llvm-svn: 180790
OpenPOWER on IntegriCloud