summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/RuntimeDyld
Commit message (Collapse)AuthorAgeFilesLines
...
* [weak vtables] Remove a bunch of weak vtablesJuergen Ributzka2013-11-153-0/+8
| | | | | | | | | | | 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-212-0/+19
| | | | llvm-svn: 193094
* Avoid duplicate search by reusing the iterator.Yaron Keren2013-10-192-5/+7
| | | | 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-164-1/+28
| | | | | | 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
* Separating ELF and MachO stub info functions for RuntimeDyldAndrew Kaylor2013-10-153-23/+39
| | | | llvm-svn: 192737
* Fixing some host==target assumptions in RuntimeDyldAndrew Kaylor2013-10-152-3/+6
| | | | llvm-svn: 192732
* Adding multiple object support to MCJIT EH frame handlingAndrew Kaylor2013-10-116-42/+108
| | | | llvm-svn: 192504
* Adding multiple GOT handling to RuntimeDyldELFAndrew Kaylor2013-10-052-59/+81
| | | | | | Patch by Ashok Thirumurthi llvm-svn: 192020
* This threads SectionName through the allocateCodeSection/allocateDataSection ↵Filip Pizlo2013-10-022-6/+7
| | | | | | | | | | | | | | | | | | 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
* 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
* memcmp is not a valid way to compare structs with padding in them.Benjamin Kramer2013-08-201-2/+9
| | | | llvm-svn: 188778
* Adding PIC support for ELF on x86_64 platformsAndrew Kaylor2013-08-194-16/+244
| | | | llvm-svn: 188726
* Adding comments to document RuntimeDyld relocation handlingAndrew Kaylor2013-08-193-1/+44
| | | | llvm-svn: 188697
* Fixed RuntimeDyldELF absolute relocations.Richard Mitton2013-08-161-1/+11
| | | | | | | | | If an ELF relocation is pointed at an absolute address, it will have a symbol ID of zero. RuntimeDyldELF::processRelocationRef was not previously handling this case, and was instead trying to handle it as a section-relative fixup. I think this is the right fix here, but my elf-fu is poor on some of the more exotic platforms, so I'd appreciate it if anyone with greater knowledge could verify this. llvm-svn: 188572
* 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
* [Object] Split the ELF interface into 3 parts.Michael J. Spencer2013-08-081-4/+3
| | | | | | | | * ELFTypes.h contains template magic for defining types based on endianess, size, and alignment. * ELFFile.h defines the ELFFile class which provides low level ELF specific access. * ELFObjectFile.h contains ELFObjectFile which uses ELFFile to implement the ObjectFile interface. llvm-svn: 188022
* [PowerPC] Support powerpc64le as a syntax-checking target.Bill Schmidt2013-07-263-4/+5
| | | | | | | | | | | | | | | | | | | | | | | 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
* AArch64: don't mask off shift bits when processing JIT relocations.Tim Northover2013-07-251-4/+4
| | | | | | | This should actually make the MCJIT tests pass again on AArch64. I don't know how I missed their failure before. llvm-svn: 187120
* [mips] Use pristine object file while processing relocations.Akira Hatanaka2013-07-241-7/+20
| | | | | | | | | | | | | | | | | | | Similar to ARM change r182800, dynamic linker will read bits/addends from the original object rather than from the object that might have been patched previously. For the purpose of relocations for MCJIT stubs on MIPS, we internally use otherwise unused MIPS relocations. The change also enables MCJIT unit tests for MIPS (EL/BE), and the following two tests now pass: - MCJITTest.return_global and - MCJITTest.multiple_functions. These issues have been tracked as Bug 16250. Patch by Petar Jovanovic. llvm-svn: 187019
* AArch64: correct CodeGen of MOVZ/MOVK combinations.Tim Northover2013-07-011-7/+8
| | | | | | | | | | | | According to the AArch64 ELF specification (4.6.8), it's the assembler's responsibility to make sure the shift amount is correct in relocated MOVZ/MOVK instructions. This wasn't being obeyed by either the MCJIT CodeGen or RuntimeDyldELF (which happened to work out well for JIT tests). This commit should make us compliant in this area. llvm-svn: 185360
* 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
* Handle (at least don't crash on) relocations with no symbols.Rafael Espindola2013-06-051-6/+11
| | | | | | Should fix the MCJIT tests on PPC. llvm-svn: 183288
* Handle relocations that don't point to symbols.Rafael Espindola2013-06-052-11/+8
| | | | | | | | 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
* Update RuntimeDyldELF::findOPDEntrySection the new relocation iterators.Rafael Espindola2013-06-031-3/+7
| | | | | | | This was missing from r182908. I didn't noticed it at the time because the MCJIT tests were disabled when building with cmake on ppc64 (which I fixed in r183143). llvm-svn: 183147
* Change how we iterate over relocations on ELF.Rafael Espindola2013-05-301-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | For COFF and MachO, sections semantically have relocations that apply to them. That is not the case on ELF. In relocatable objects (.o), a section with relocations in ELF has offsets to another section where the relocations should be applied. In dynamic objects and executables, relocations don't have an offset, they have a virtual address. The section sh_info may or may not point to another section, but that is not actually used for resolving the relocations. This patch exposes that in the ObjectFile API. It has the following advantages: * Most (all?) clients can handle this more efficiently. They will normally walk all relocations, so doing an effort to iterate in a particular order doesn't save time. * llvm-readobj now prints relocations in the same way the native readelf does. * probably most important, relocations that don't point to any section are now visible. This is the case of relocations in the rela.dyn section. See the updated relocation-executable.test for example. llvm-svn: 182908
* ARM: use pristine object file while processing relocationsTim Northover2013-05-281-15/+23
| | | | | | | | | | | | | | Previously we would read-modify-write the target bits when processing relocations for the MCJIT. This had the problem that when relocations were processed multiple times for the same object file (as they can be), the result is not idempotent and the values became corrupted. The solution to this is to take any bits used in the destination from the pristine object file as LLVM emitted it. This should fix PR16013 and remote MCJIT on ARM ELF targets. llvm-svn: 182800
* Put RTDyldMemoryManager into its own file, and make it linked into Filip Pizlo2013-05-211-2/+0
| | | | | | | | | | | | | | | | | | libExecutionEngine. Move method implementations that aren't specific to allocation out of SectionMemoryManager and into RTDyldMemoryManager. This is in preparation for exposing RTDyldMemoryManager through the C API. This is a fixed version of r182407 and r182411. That first revision broke builds because I forgot to move the conditional includes of various POSIX headers from SectionMemoryManager into RTDyldMemoryManager. Those includes are necessary because of how getPointerToNamedFunction works around the glibc libc_nonshared.a thing. The latter revision still broke things because I forgot to include llvm/Config/config.h. llvm-svn: 182418
* Roll out r182411 and 182412 because it's still broken.Filip Pizlo2013-05-211-0/+2
| | | | llvm-svn: 182415
* Put RTDyldMemoryManager into its own file, and make it linked into Filip Pizlo2013-05-211-2/+0
| | | | | | | | | | | | | | | | libExecutionEngine. Move method implementations that aren't specific to allocation out of SectionMemoryManager and into RTDyldMemoryManager. This is in preparation for exposing RTDyldMemoryManager through the C API. This is a fixed version of r182407. That revision broke builds because I forgot to move the conditional includes of various POSIX headers from SectionMemoryManager into RTDyldMemoryManager. Those includes are necessary because of how getPointerToNamedFunction works around the glibc libc_nonshared.a thing. llvm-svn: 182411
* Roll out r182407 and r182408 because they broke builds.Filip Pizlo2013-05-211-0/+2
| | | | llvm-svn: 182409
* Put RTDyldMemoryManager into its own file, and make it linked into Filip Pizlo2013-05-211-2/+0
| | | | | | | | | | libExecutionEngine. Move method implementations that aren't specific to allocation out of SectionMemoryManager and into RTDyldMemoryManager. This is in preparation for exposing RTDyldMemoryManager through the C API. llvm-svn: 182407
* AArch64: make RuntimeDyld relocations idempotentTim Northover2013-05-191-2/+22
| | | | | | | | | | AArch64 ELF uses .rela relocations so there's no need to actually make use of the bits we're setting in the destination However, we should make sure all bits are cleared properly since multiple runs of resolveRelocations are possible and these could combine to produce invalid results if stale versions remain in the code. llvm-svn: 182214
* r182085 introduced a change that triggered an assertion on ARM. This is an ↵David Tweed2013-05-171-2/+4
| | | | | | | | immediate fix which doesn't resolve the deeper problem. llvm-svn: 182098
* Change getRelocationAdditionalInfo to be ELF only.Rafael Espindola2013-05-091-4/+4
| | | | | | | It was only implemented for ELF where it collected the Addend, so this patch also renames it to getRelocationAddend. llvm-svn: 181502
* PowerPC: Fix unimplemented relocation on ppc64Adhemerval Zanella2013-05-061-0/+5
| | | | | | | This patch handles the R_PPC64_REL64 relocation type for powerpc64 for mcjit. llvm-svn: 181220
* Add EH support to the MCJIT.Rafael Espindola2013-05-056-7/+115
| | | | | | | | | 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
* AArch64: implement 64-bit absolute relocation in MCJITTim Northover2013-05-041-0/+5
| | | | | | | | | This is about the simplest relocation, but surprisingly rare in actual code. It occurs in (for example) the MCJIT test test-ptr-reloc.ll. llvm-svn: 181134
* AArch64: add stubs to support long function calls on MCJITTim Northover2013-05-043-2/+84
| | | | | | | | | | | | | | | | | | | | As with global accesses, external functions could exist anywhere in memory. Therefore the stub must create a complete 64-bit address. This patch implements the fragment as (roughly): movz x16, #:abs_g3:somefunc movk x16, #:abs_g2_nc:somefunc movk x16, #:abs_g1_nc:somefunc movk x16, #:abs_g0_nc:somefunc br x16 In principle we could save 4 bytes by using a literal-load instead, but it is unclear that would be more efficient and can only be tested when real hardware is readily available. This allows (for example) the MCJIT test 2003-05-07-ArgumentTest to pass on AArch64. llvm-svn: 181133
* AArch64: implement relocations for global accessTim Northover2013-05-041-0/+31
| | | | | | | | | | | | | | | | | The large memory model (default and main viable for JIT) emits addresses in need of relocation as movz x0, #:abs_g3:somewhere movk x0, #:abs_g2_nc:somewhere movk x0, #:abs_g1_nc:somewhere movk x0, #:abs_g0_nc:somewhere To support this we must implement those four relocations in the dynamic loader. This allows (for example) the test-global.ll MCJIT test to pass on AArch64. llvm-svn: 181132
* AArch64: implement first relocation required for MCJITTim Northover2013-05-042-0/+39
| | | | | | | | | | | R_AARCH64_PCREL32 is present in even trivial .eh_frame sections and so is required to compile any function without the "nounwind" attribute. This change implements very basic infrastructure in the RuntimeDyldELF file and allows (for example) the test-shift.ll MCJIT test to pass on AArch64. llvm-svn: 181131
OpenPOWER on IntegriCloud