Loading and Executing Object Code at Runtime

uunet!bria!mike uunet!bria!mike
Thu Feb 14 18:22:52 AEST 1991


In an article, flan at cics.Berkeley.EDU (Ian Flanigan) writes:
>Hi,
>
>I tried posting this to comp.unix.questions first, but as I got no answer
>I figured this must be a Wizard level question:
>
>I'm wondering how to load an object file (my_functions.o) at execution
>time and execute a function contained therein.  I know this is possible
>since many flavors of LISP allow you to compile your functions and then
>load the compiled versions later.

When you are talking about compiling functions and loading the compiled
versions later, are you talking about using a linkage editor to build
a runable image?

If you're trying to do what it looks like you're trying to do, the answer
is "you can't get there from here."  You would have open the object file,
load the function within the context of the current process (a real trick),
allocate the core for data, stack, and bbs, push the stack frame, and
jump to the address of this arbitrary function.  Just ain't no way you
can be doin' this in user mode.

-- 
Michael Stefanik                       | Opinions stated are not even my own.
Systems Engineer, Briareus Corporation | UUCP: ...!uunet!bria!mike
-------------------------------------------------------------------------------
technoignorami (tek'no-ig'no-ram`i) a group of individuals that are constantly
found to be saying things like "Well, it works on my DOS machine ..."



More information about the Comp.unix.wizards mailing list