search for: setrelocationmodel

Displaying 17 results from an estimated 17 matches for "setrelocationmodel".

Did you mean: getrelocationmodel
2014 Jan 07
2
[LLVMdev] Generating PIC object files from the LLVM API
...ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in <...>. To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie This novice developer thought that the solution would be: engineBuilder.setRelocationModel(Reloc::PIC_); However this has no diff in the resulting object file. Have I overlooked something simple? Is this feature not supported and I need to link with -Wl,-no_pie? Thanks in advance! v/r Josh TL;DR: engineBuilder.setRelocationModel(Reloc::PIC_) appears to have no effect when generating...
2019 Feb 09
2
[IR][AsmPrinter][MCJIT]: ensure every x64 "CALL" to Jit function uses relative address
...hin 2GB of of what it's calling, so the offset may > be too big. > > > The goal is to be able to move the entire JIT program memory somewhere > else and still be able to run the program. > > It sounds like you need to configure the ExecutionEngine to use PIC > mode with setRelocationModel. With that, LLVM do some GOT magic to get > the right address to jump to and then use an absolute jump to that > register. You still have to arrange for the GOT to contain the right > value (looks like it's the address of the function relative to the > start of the GOT at first glan...
2019 Feb 09
2
[IR][AsmPrinter][MCJIT]: ensure every x64 "CALL" to Jit function uses relative address
Hi, Is it possible to tell LLVM somewhere that we prefer the asm printer to use x64 relative CALL (0xFF) instead of absolute one ? The goal is to be able to move the entire JIT program memory somewhere else and still be able to run the program. Thanks ! -------------- next part -------------- An HTML attachment was scrubbed... URL:
2010 Jun 17
0
[LLVMdev] Relocation issue with jump tables in ELF object files on X86_64
...al linker doesn’t > patch the instruction, does the ELF loader always try to load .rodata > segments in the low 2GB of memory regardless of if it is from the main image > or from a shared library? > > > > Thanks for any help. Perhaps you're missing a call to TargetMachine::setRelocationModel? It sounds like you need PIC codegen. -Eli
2013 Mar 17
3
[LLVMdev] Memory clean for applications using LLVM for JIT compilation
Thanks for the reply, nice to have some validation. I thought of another approach which might be preferable: generate relocatable code, use a JITEventListener to grab each function and copy it to my own memory, let all the LLVM stuff die normally then use my copy of the code. However when I call setRelocationModel(Reloc::PIC_) on the engine builder I get code that seg faults. The assembly looks plausible at a glance, but I'm not really up to speed on x86 assembly. Is PIC supposed to work with JIT on X86-32? On Sat, Mar 16, 2013 at 11:35 AM, Dirkjan Bussink <d.bussink at gmail.com> wrote: > >...
2010 Jun 17
2
[LLVMdev] Relocation issue with jump tables in ELF object files on X86_64
(llvm 2.6) We have an application where we are using LLVM to generate ELF object files for X86_64. At runtime we load these objects files into memory using our own ELF loader. Everything is working except for the jump tables. The ELF emitter is generating JMPQ instructions using X86::reloc_absolute_word_sext relocations which we are unable to patch to the jump table in the .rodata segment
2019 Feb 25
2
[IR][AsmPrinter][MCJIT]: ensure every x64 "CALL" to Jit function uses relative address
...>>> be too big. >>> >>> > The goal is to be able to move the entire JIT program memory somewhere >>> else and still be able to run the program. >>> >>> It sounds like you need to configure the ExecutionEngine to use PIC >>> mode with setRelocationModel. With that, LLVM do some GOT magic to get >>> the right address to jump to and then use an absolute jump to that >>> register. You still have to arrange for the GOT to contain the right >>> value (looks like it's the address of the function relative to the >>&gt...
2010 Jun 17
2
[LLVMdev] Relocation issue with jump tables in ELF object files on X86_64
...inker doesn't > patch the instruction, does the ELF loader always try to load .rodata > segments in the low 2GB of memory regardless of if it is from the main image > or from a shared library? > > > > Thanks for any help. Perhaps you're missing a call to TargetMachine::setRelocationModel? It sounds like you need PIC codegen. -Eli _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
2020 Jan 08
2
Position independent code writes absolute pointer
...f("Planschi...\n"); printf("The magic value is %i 0x%p && 0x%p\n", magicValue, &magicValue, pValue); } void setMagicValue(int value) { magicValue = value; } This is the code which I will load as PIC, for the JTMB I use the following settings: JTMB->setRelocationModel(llvm::Reloc::PIC_); JTMB->setCodeModel(llvm::CodeModel::Small); The code will be loaded into a shared memory. Two process will execute the memory from there, calling "printMagicValue", "setMagicValue(120)" and "printMagicValue" again. Only the first process will JIT...
2013 Mar 19
0
[LLVMdev] Memory clean for applications using LLVM for JIT compilation
...Thanks for the reply, nice to have some validation. I thought of another approach which might be preferable: generate relocatable code, use a JITEventListener to grab each function and copy it to my own memory, let all the LLVM stuff die normally then use my copy of the code. However when I call setRelocationModel(Reloc::PIC_) on the engine builder I get code that seg faults. The assembly looks plausible at a glance, but I'm not really up to speed on x86 assembly. Is PIC supposed to work with JIT on X86-32? On Sat, Mar 16, 2013 at 11:35 AM, Dirkjan Bussink <d.bussink at gmail.com> wrote: > >...
2013 Mar 23
2
[LLVMdev] Memory clean for applications using LLVM for JIT compilation
...or the reply, nice to have some validation. I thought of another approach which might be preferable: > generate relocatable code, use a JITEventListener to grab each function and copy it to my own memory, let all the LLVM stuff die normally then use my copy of the code. > However when I call setRelocationModel(Reloc::PIC_) on the engine builder I get code that seg faults. > The assembly looks plausible at a glance, but I'm not really up to speed on x86 assembly. > Is PIC supposed to work with JIT on X86-32? > > On Sat, Mar 16, 2013 at 11:35 AM, Dirkjan Bussink <d.bussink at gmail.com&...
2013 Mar 16
0
[LLVMdev] Memory clean for applications using LLVM for JIT compilation
On Mar 7, 2013, at 20:48 , Frank Henigman <fjhenigman at google.com> wrote: > I derived a class from JITMemoryManager which delegates everything to > an instance made with CreateDefaultMemManager(). ExecutionEngine > destroys the wrapper, but I keep the inner instance which did the > actual work. Works, but seems a bit ugly. Did you find any other > solutions? I ended up
2013 Mar 23
0
[LLVMdev] Memory clean for applications using LLVM for JIT compilation
...or the reply, nice to have some validation. I thought of another approach which might be preferable: > generate relocatable code, use a JITEventListener to grab each function and copy it to my own memory, let all the LLVM stuff die normally then use my copy of the code. > However when I call setRelocationModel(Reloc::PIC_) on the engine builder I get code that seg faults. > The assembly looks plausible at a glance, but I'm not really up to speed on x86 assembly. > Is PIC supposed to work with JIT on X86-32? > > On Sat, Mar 16, 2013 at 11:35 AM, Dirkjan Bussink <d.bussink at gmail.com&g...
2013 Mar 20
2
[LLVMdev] Memory clean for applications using LLVM for JIT compilation
...or the reply, nice to have some validation. I thought of another approach which might be preferable: > generate relocatable code, use a JITEventListener to grab each function and copy it to my own memory, let all the LLVM stuff die normally then use my copy of the code. > However when I call setRelocationModel(Reloc::PIC_) on the engine builder I get code that seg faults. > The assembly looks plausible at a glance, but I'm not really up to speed on x86 assembly. > Is PIC supposed to work with JIT on X86-32? > > On Sat, Mar 16, 2013 at 11:35 AM, Dirkjan Bussink <d.bussink at gmail.com&g...
2013 Mar 08
2
[LLVMdev] Memory clean for applications using LLVM for JIT compilation
> On 14 Jan 2013, at 15:48, Reid Kleckner <rnk at google.com> wrote: > > > > Or maybe would it be possible to have a custom allocator for memory space for the native code that we could provide? With this last option we would be responsible for the clean up ourselves and just provide memory space to LLVM where it can store the results. > > > > Yes, you should be
2010 Jun 17
0
[LLVMdev] Relocation issue with jump tables in ELF object files on X86_64
...inker doesn't > patch the instruction, does the ELF loader always try to load .rodata > segments in the low 2GB of memory regardless of if it is from the main image > or from a shared library? > > > > Thanks for any help. Perhaps you're missing a call to TargetMachine::setRelocationModel? It sounds like you need PIC codegen. -Eli _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
2013 Mar 20
0
[LLVMdev] Memory clean for applications using LLVM for JIT compilation
...or the reply, nice to have some validation. I thought of another approach which might be preferable: > generate relocatable code, use a JITEventListener to grab each function and copy it to my own memory, let all the LLVM stuff die normally then use my copy of the code. > However when I call setRelocationModel(Reloc::PIC_) on the engine builder I get code that seg faults. > The assembly looks plausible at a glance, but I'm not really up to speed on x86 assembly. > Is PIC supposed to work with JIT on X86-32? > > On Sat, Mar 16, 2013 at 11:35 AM, Dirkjan Bussink <d.bussink at gmail.com&g...