Autoloading a module

9:00 pm jde, jderobot

Some time ago I made some tests on dlopened modules, trying to find some simple autoloading mechanisms. The usual way we were using dlopen was followed by a dlsym calls collection. This way you can get functions defined inside the module. But this forces the application to know the searched symbols names.

An easy way to avoid this is letting the module to register itself, providing some registering mechanism, on loading time. So the only requirement is some kind of constructor called inmediatelly after dlopen call. gcc function atributes in C and variable initialization through functions in C++ are really easy ways to get this pourpouse.

More info can be found here.

Leave a Comment

Your comment

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.