summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Back out r208257 while I investigate tester failures.Lang Hames2014-05-071-14/+0
| | | | llvm-svn: 208267
* [RuntimeDyld] Make RuntimeDyldImpl::resolveExternalSymbols preserve theLang Hames2014-05-071-0/+14
| | | | | | | | | | | | | | | | | relocation entries it applies. Prior to this patch, RuntimeDyldImpl::resolveExternalSymbols discarded relocations for external symbols once they had been applied. This causes issues if the client calls MCJIT::finalizeLoadedModules more than once, and updates the location of any symbols in between (e.g. by calling MCJIT::mapSectionAddress). No test case yet: None of our in-tree memory managers support moving sections around. I'll have to hack up a dummy memory manager before I can write a unit test. Fixes <rdar://problem/16764378> llvm-svn: 208257
* [ARM64] Try and make the ELF MCJIT *slightly* less broken for ARM64.James Molloy2014-04-301-1/+2
| | | | | | | | | A bunch of switch cases were missing, not just for ARM64 but also for AArch64_BE. I've fixed all those, but there's zero testing as ExecutionEngine tests are disabled when crosscompiling and I don't have a native platform available to test on. llvm-svn: 207626
* PR19553: Memory leak in RuntimeDyldELF::createObjectImageFromFileDavid Blaikie2014-04-291-4/+6
| | | | | | | | | | | | | | | | 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. llvm-svn: 207580
* [C++] Use 'nullptr'.Craig Topper2014-04-241-6/+6
| | | | 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
* Revert "[rtdyld,c++11] Range'ify symbol table walking."Jim Grosbach2014-04-211-25/+33
| | | | | | | | | Tentative revert for http://lab.llvm.org:8011/builders/llvm-mips-linux/builds/8305. This reverts commit c2a58efff07294fca724f89500538f2ddbcd12ff. llvm-svn: 206773
* [rtdyld,c++11] Range'ify symbol table walking.Jim Grosbach2014-04-211-33/+25
| | | | llvm-svn: 206769
* Convert getFileOffset to getOffset and move it to its only user.Rafael Espindola2014-04-211-9/+32
| | | | | | | | | | | | | We normally don't drop functions from the C API's, but in this case I think we can: * The old implementation of getFileOffset was fairly broken * The introduction of LLVMGetSymbolFileOffset was itself a C api breaking change as it removed LLVMGetSymbolOffset. * It is an incredibly specialized use case. The only reason MCJIT needs it is because of its odd position of being a dynamic linker of .o files. llvm-svn: 206750
* Remove section_rel_empty. Just compare begin() and end() instead.Rafael Espindola2014-04-031-3/+5
| | | | llvm-svn: 205577
* Add ARM big endian Target (armeb, thumbeb)Christian Pirker2014-03-281-1/+1
| | | | | | Reviewed at http://llvm-reviews.chandlerc.com/D3095 llvm-svn: 205007
* [MCJIT] Check if there have been errors during RuntimeDyld execution.Juergen Ributzka2014-03-261-0/+2
| | | | llvm-svn: 204837
* AArch64_BE Elf support for MC-JIT runtime dynamic linkerChristian Pirker2014-03-261-1/+1
| | | | llvm-svn: 204816
* [RuntimeDyld] clang-format files.Juergen Ributzka2014-03-211-124/+104
| | | | llvm-svn: 204507
* [RuntimeDyld] Allow processRelocationRef to process more than one relocation ↵Juergen Ributzka2014-03-211-11/+12
| | | | | | | | | | | | | 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
* Add an option to MCJIT to have it forward all sections to theLang Hames2014-03-201-16/+30
| | | | | | | | | | | | | | | | | | | | | | RTDyldMemoryManager, regardless of whether it thinks they're "required for execution". Currently, RuntimeDyld only passes sections that are "required for execution" to the RTDyldMemoryManager, and takes "required for execution" to mean exactly "contains symbols or relocations". There are two problems with this: (1) It can drop sections with anonymous data that is referenced by code. (2) It leaves the JIT client no way to inspect interesting sections that aren't actually required to run the program (e.g dwarf sections). A test case is still in the works. Future work: We may want to replace this with a generic section filtering mechanism, but that will require more consideration. For now, this flag at least allows clients to volunteer to do the filtering themselves. Fixes <rdar://problem/15177691>. llvm-svn: 204398
* [C++11] Introduce SectionRef::relocations() to use range-based loopsAlexey Samsonov2014-03-141-8/+5
| | | | | | | | | | | | Reviewers: rafael Reviewed By: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3077 llvm-svn: 203927
* Make createObjectImage and createObjectImageFromFile static methods on theLang Hames2014-03-081-64/+56
| | | | | | | | relevant subclasses of RuntimeDyldImpl. This allows construction of RuntimeDyldImpl instances to be deferred until after the target architecture is known. llvm-svn: 203352
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-061-1/+1
| | | | | | | | | | 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
* [C++11] Replace OwningPtr::take() with OwningPtr::release().Ahmed Charles2014-03-051-1/+1
| | | | llvm-svn: 202957
* Extend RTDyld API to enable optionally precomputing the total amount of memoryLang Hames2014-02-121-65/+187
| | | | | | | | | | | | | | | | | | required for all sections in a module. This can be useful when targets or code-models place strict requirements on how sections must be laid out in memory. If RTDyldMemoryManger::needsToReserveAllocationSpace() is overridden to return true then the JIT will call the following method on the memory manager, which can be used to preallocate the necessary memory. void RTDyldMemoryManager::reserveAllocationSpace(uintptr_t CodeSize, uintptr_t DataSizeRO, uintptr_t DataSizeRW) Patch by Vaidas Gasiunas. Thanks very much Viadas! llvm-svn: 201259
* In RuntimeDyldImpl::emitSection, make Allocate (section size to be allocated) aLang Hames2014-02-111-1/+1
| | | | | | | | | | | | | uintptr_t. An unsigned could overflow for large sections. No test case - anything big enough to overflow an unsigned is going to take an appreciable time to zero when the test passes. The choice of uintptr_t was made to match the RTDyldMemoryManager APIs, but these should probably be hardcoded to uint64_ts: It is legitimate to JIT for 64-bit targets from a 32-bit host/compiler. llvm-svn: 201127
* Change the begin and end methods in ObjectFile to match the style guide.Rafael Espindola2014-02-101-6/+6
| | | | llvm-svn: 201108
* Simplify getSymbolFlags.Rafael Espindola2014-01-311-2/+1
| | | | | | | None of the object formats require extra parsing to compute these flags, so the method cannot fail. llvm-svn: 200574
* Simplify the handling of iterators in ObjectFile.Rafael Espindola2014-01-301-14/+10
| | | | | | | | | | | | None of the object file formats reported error on iterator increment. In retrospect, that is not too surprising: no object format stores symbols or sections in a linked list or other structure that requires chasing pointers. As a consequence, all error checking can be done on begin() and end(). This reduces the text segment of bin/llvm-readobj in my machine from 521233 to 518526 bytes. llvm-svn: 200442
* Re-apply r196639: Add support for archives and object file caching under MCJIT.Lang Hames2014-01-081-3/+31
| | | | | | | | | 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
* Re-sort all of the includes with ./utils/sort_includes.py so thatChandler Carruth2014-01-071-1/+1
| | | | | | | | | | subsequent changes are easier to review. About to fix some layering issues, and wanted to separate out the necessary churn. Also comment and sink the include of "Windows.h" in three .inc files to match the usage in Memory.inc. llvm-svn: 198685
* Whitespace cleanups.NAKAMURA Takumi2013-12-071-1/+1
| | | | llvm-svn: 196654
* Revert r196639 while I investigate a bot failure.Lang Hames2013-12-071-31/+3
| | | | llvm-svn: 196641
* Add support for archives and object file caching under MCJIT.Lang Hames2013-12-071-3/+31
| | | | | | Patch by Andy Kaylor, with minor edits to resolve merge conflicts. llvm-svn: 196639
* [weak vtables] Remove a bunch of weak vtablesJuergen Ributzka2013-11-191-0/+6
| | | | | | | | | | | | This patch removes most of the trivial cases of weak vtables by pinning them to a single object file. The memory leaks in this version have been fixed. Thanks Alexey for pointing them out. Differential Revision: http://llvm-reviews.chandlerc.com/D2068 Reviewed by Andy llvm-svn: 195064
* Revert r194865 and r194874.Alexey Samsonov2013-11-181-6/+0
| | | | | | | | | | | | This change is incorrect. If you delete virtual destructor of both a base class and a subclass, then the following code: Base *foo = new Child(); delete foo; will not cause the destructor for members of Child class. As a result, I observe plently of memory leaks. Notable examples I investigated are: ObjectBuffer and ObjectBufferStream, AttributeImpl and StringSAttributeImpl. llvm-svn: 194997
* [weak vtables] Remove a bunch of weak vtablesJuergen Ributzka2013-11-151-0/+6
| | | | | | | | | | | This patch removes most of the trivial cases of weak vtables by pinning them to a single object file. Differential Revision: http://llvm-reviews.chandlerc.com/D2068 Reviewed by Andy llvm-svn: 194865
* Path: Recognize COFF import library file magic.Rui Ueyama2013-11-151-0/+1
| | | | | | | | | | | | Summary: Make identify_magic to recognize COFF import file. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2165 llvm-svn: 194852
* Fixing a problem with iterator validity in ↵Andrew Kaylor2013-11-111-2/+12
| | | | | | RuntimeDyldImpl::resolveExternalSymbols llvm-svn: 194415
* Improving MCJIT/RuntimeDyld thread safetyAndrew Kaylor2013-10-211-0/+6
| | | | llvm-svn: 193094
* Avoid duplicate search by reusing the iterator.Yaron Keren2013-10-191-1/+1
| | | | llvm-svn: 193034
* Adding padding to the .eh_frame section in RuntimeDyldAndrew Kaylor2013-10-161-1/+15
| | | | llvm-svn: 192754
* Adding support for deregistering EH frames with MCJIT.Andrew Kaylor2013-10-161-1/+10
| | | | | | Patch by Yaron Keren llvm-svn: 192753
* Path: Recognize Windows compiled resource file.Rui Ueyama2013-10-151-0/+1
| | | | | | | | | | | | | | Some background: One can pass compiled resource files (.res files) directly to the linker on Windows. If a resource file is given, the linker will run "cvtres" command in background to convert the resource file to a COFF file to link it. What I'm trying to do with this patch is to make the linker to recognize the resource file by file magic, so that it can run cvtres command. Differential Revision: http://llvm-reviews.chandlerc.com/D1943 llvm-svn: 192742
* Fixing some host==target assumptions in RuntimeDyldAndrew Kaylor2013-10-151-0/+2
| | | | llvm-svn: 192732
* Adding multiple object support to MCJIT EH frame handlingAndrew Kaylor2013-10-111-5/+4
| | | | llvm-svn: 192504
* This threads SectionName through the allocateCodeSection/allocateDataSection ↵Filip Pizlo2013-10-021-4/+5
| | | | | | | | | | | | | | | | | | APIs, both in C++ and C land. It's useful for the memory managers that are allocating a section to know what the name of the section is. At a minimum, this is useful for low-level debugging - it's customary for JITs to be able to tell you what memory they allocated, and as part of any such dump, they should be able to tell you some meta-data about what each allocation is for. This allows clients that supply their own memory managers to do this. Additionally, we also envision the SectionName being useful for passing meta-data from within LLVM to an LLVM client. This changes both the C and C++ APIs, and all of the clients of those APIs within LLVM. I'm assuming that it's safe to change the C++ API because that API is allowed to change. I'm assuming that it's safe to change the C API because we haven't shipped the API in a release yet (LLVM 3.3 doesn't include the MCJIT memory management C API). llvm-svn: 191804
* Adding multiple module support for MCJIT.Andrew Kaylor2013-10-011-20/+36
| | | | | | | | Tests to follow. PIC with small code model and EH frame handling will not work with multiple modules. There are also some rough edges to be smoothed out for remote target support. llvm-svn: 191722
* Adding PIC support for ELF on x86_64 platformsAndrew Kaylor2013-08-191-0/+8
| | | | llvm-svn: 188726
* Adding comments to document RuntimeDyld relocation handlingAndrew Kaylor2013-08-191-0/+3
| | | | llvm-svn: 188697
* [PowerPC] Support powerpc64le as a syntax-checking target.Bill Schmidt2013-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This patch provides basic support for powerpc64le as an LLVM target. However, use of this target will not actually generate little-endian code. Instead, use of the target will cause the correct little-endian built-in defines to be generated, so that code that tests for __LITTLE_ENDIAN__, for example, will be correctly parsed for syntax-only testing. Code generation will otherwise be the same as powerpc64 (big-endian), for now. The patch leaves open the possibility of creating a little-endian PowerPC64 back end, but there is no immediate intent to create such a thing. The LLVM portions of this patch simply add ppc64le coverage everywhere that ppc64 coverage currently exists. There is nothing of any import worth testing until such time as little-endian code generation is implemented. In the corresponding Clang patch, there is a new test case variant to ensure that correct built-in defines for little-endian code are generated. llvm-svn: 187179
* Basic support for parsing Mach-O universal binaries in LLVMObject libraryAlexey Samsonov2013-06-181-0/+1
| | | | llvm-svn: 184191
* Convert another use of sys::identifyFileType.Rafael Espindola2013-06-111-26/+28
| | | | | | No functionality change. llvm-svn: 183758
* Pass a StringRef to sys::identifyFileType.Rafael Espindola2013-06-101-3/+1
| | | | llvm-svn: 183669
OpenPOWER on IntegriCloud