loadable modules

Stanley Jobson stanley.jobson at gmx.ch
Thu Nov 3 08:55:55 UTC 2005


> 
> >hi,
> >i am trying to add a "loadable modules" feature to my app. currently
> >this app is running on i386.
> >  
> >
> 
> I don't know esh but cexp works on i386 
> (http://www.slac.stanford.edu/~strauman/rtems/).
> You might also want to check out the rtems evaluation CD...
> 

definitively interesting - thx - but rather complex :) i only need to
execute functions on object files

does anyone know a howto or hello world example showing how to use BFD lib
to execute functions on obj files ?

thx
regards,
stan


> 
> >i found libesh which includes libld and libstab. i extracted these too
> >libs and worked through the given READMEs and examples.
> >
> >i managed to build a relocatable object and include it into the image
> >(created a tar, converted it into an obj, linked it to the app and used
> >imfs and untar_frommemory to make it available at runtime).
> >
> >with the following code i tried to execute a function on the module:
> >
> >    module_t mod;
> >    int (*execute)(void);
> >    
> >    loader_init();
> >    mod = loader_load("/imfs/module.so");
> >    loader_show();
> >   
> >    printf("execute()\n"); 
> >    execute = LoaderSymbol("execute");
> >    execute();
> >        
> >    loader_unload(mod);
> >
> >everything works fine til the "execute()" call which causes an rtems
> >panic. i am sure i missed something but i have no idea what.
> >
> >i still do not understand the use of mkstab :( ... it creates a function
> >system_symbol_table_init(). who calls it ? when?
> >
> >does anyone use this loader?
> >is there any more init necessary (e.g. symbol table)? how?
> >any working examples available (apart from the hello world in libesh) ?
> >
> >much thx,
> >regards,
> >stan
> >
> >
> >
> >
> >  
> >
> 



More information about the users mailing list