Here is what I want to do:
I think you may be able to accomplish this using dynamic libraries and loading them at runtime (using dlopen
and friends).
void * lib = dlopen("mynewcode.so", RTLD_LAZY);
if(lib) {
void (*fn)(void) = dlsym(lib, "libfunc");
if(fn) fn();
dlclose(lib);
}
You would obviously have to be compiling the new code as you go along, but if you keep replacing mynewcode.so
I think this will work for you.