Displaying 4 results from an estimated 4 matches for "readandrelocatecodefromfile".
2005 May 27
3
[LLVMdev] Lightweight code loader
...rt should be as light as possible - that is, very small
// in size of the compiled binary. The resulting "module" is fairly static, not like
// standard llvm modules.
// should be able to get pointers to functions and change value of
// global pointers.
NativeModule * mod = ReadAndRelocateCodeFromFile ("file");
int (* countdown) (int);
countdown = (int (*)(int)) GetPointerToFunction("countdown",mod);
printf("result of countdown: %d\n", countdown (1000000));
***
There are a few problems that I need some input on.
First, I want the loader to be as tiny as...
2005 May 27
0
[LLVMdev] Lightweight code loader
Alexander,
Yes, a patch like that would be accepted. Fewer dependencies = good :)
Some notes on doing this:
(1) Please make sure you use the std c++ iostream libraries for doing
I/O. No native calls (we end up with portability problems). If you need
something that must be ported, please add it to lib/System
(2) You should also use the sys::Path class (include/llvm/System/Path.h)
for handling
2005 May 27
2
[LLVMdev] Lightweight code loader
On May 16, Chris Lattner wrote:
> On Mon, 16 May 2005, Alexander Friedman wrote:
> > Would it be possible (ie, relatively straitforward) to do the
> > following: Take the code in module A, compile it with the JIT (since
> > we cannot make libraries in Windows), and save the resulting binary
> > goo in some file. Later (in a different instance of the runtime), with
>
2005 May 27
0
[LLVMdev] Lightweight code loader
...is, very small
> // in size of the compiled binary. The resulting "module" is fairly static, not like
> // standard llvm modules.
>
> // should be able to get pointers to functions and change value of
> // global pointers.
>
>
> NativeModule * mod = ReadAndRelocateCodeFromFile ("file");
>
> int (* countdown) (int);
>
> countdown = (int (*)(int)) GetPointerToFunction("countdown",mod);
>
> printf("result of countdown: %d\n", countdown (1000000));
>
> ***
>
The above looks pretty succinct to me. The only c...