<div dir="ltr"><div>Suppose that i have may own implementation for the JITMemoryManager which takes care of that the allocated chunks of memory to be continus.</div>
<div>So i don't understand is the generated JIT code is position-independed ? or at least can i obligue the jitter to emit PIC code only with something like options flag ?<br></div>
<div class="gmail_quote">On Mon, Jun 27, 2011 at 7:48 AM, Reid Kleckner <span dir="ltr"><<a href="mailto:reid.kleckner@gmail.com">reid.kleckner@gmail.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">It is possible to subclass JITMemoryManager and pass in a custom memory manager, but I don't believe you'll be able to convince the JIT to emit PIC code without hacking on LLVM a bit. 
<div>
<div>
<div><br></div>
<div>Reid<br><br>
<div class="gmail_quote">
<div>
<div></div>
<div class="h5">On Sun, Jun 26, 2011 at 4:21 AM, Mohammed Ag <span dir="ltr"><<a href="mailto:admirer4@gmail.com" target="_blank">admirer4@gmail.com</a>></span> wrote:<br></div></div>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>
<div></div>
<div class="h5">
<div dir="ltr">
<table>
<tbody>
<tr>
<td>
<div><a title="This question shows research effort; it is useful and clear (click again to undo)"></a>
<div><b></b></div></div></td>
<td>
<div>
<div>
<p>I have question relating to LLVM Jitter: Can i obligue the LLVM Jitter to emit the native code in continuous memory addresses ? and to be PIC ? what i want to do is to move the JIT code to another process in order to execute it, my approach is to save the JIT code in buffer i will save it to file and pass it to the execution process.</p>

<p>what i mean by "load" is to simply read the bits from file into buffer i don't want to generate elf or something like this.</p>
<p>Here's an example: suppose i have C source file which contain:</p><pre><code>Global variables
----------------
Function Foo()
----------------
Function Too()
</code></pre>
<p>when i request the JIT code i want the JIT to be in continuous memory addresses (with 4-bytes aligment):</p><pre><code>0x100: Global Vars (take 16 Byte)
0x110: Foo() Code (take 32 Byte)
0x130: Too() Code (take 32 Byte)
0x150: end.</code></pre><pre><code>So i can save the JIT code (form 0x100 -> 0x150) and i can load it in the execution process in any virtual address, <br>assume (0x300 -> 0x350) and execute it by jump to the ep.</code><code> 
</code></pre></div></div></td></tr></tbody></table></div><br></div></div>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu/" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br><br></blockquote></div><br></div></div></div></blockquote></div><br></div>