[opensuse-factory] dlopen 'ed modules interdependencies

Hi: Suppose I have 3 modules to be dlopen'ed by executable MYPROG. foo.so, bar.so, epicfail.so epicfail.so needs symbols from bar.so and bar.so needs symbols from foo.so. Usually iif such symbols cannot be resolved because bar or foo has not been loaded or has fail, programs will either abort or print an unfriendly message that bar_mysymbol is not defined or similar. Is there any way to programatically tell the dynamic linker: "load foo, then bar, then epicfail and shutdown in a way that makes sense if that is not possible, let my app to print a message and return EXIT_FAILURE cleanly" I am aware that I can tell the application to load modules in an specific order providing modules some magic dependency information, reading it at load time and then proceeding ... however my search for a clean OS/linker level solution has not been successful. is there any way to do this in a sane manner or I am missing something ? Cheers. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org

On Wed, 15 Aug 2012 13:09:54 -0400 Cristian Rodríguez <crrodriguez@opensuse.org> wrote:
Hi, maybe I do not understand your question correctly, but I think depmod is what you are looking for. kr, Dieter -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org

El 15/08/12 14:05, dieter escribió:
maybe I do not understand your question correctly, but I think depmod is what you are looking for.
something like depmod, yeah, but not in the kernel side and at application runtime... -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org

On Wed, 15 Aug 2012 14:14:17 -0400 Cristian Rodríguez <crrodriguez@opensuse.org> wrote:
sorry, I was confused by "modules". when a library is created the -l parameter is used, e.g. -lfoo for building libbar.so, and -lbar for building libepicfail.so, to tell the linker about its dependencies. Therefore I would think a user of libopenfail does not need to know its dependencies and care about loading them in the correct order. If the libraries foo and bar also use dlopen() to load the libs they depend on they have to do it themselves, and not the application which uses libepicfail.so. At least this is my picture... Dieter -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org

Cristian Rodríguez <crrodriguez@opensuse.org> writes:
From the man page:
void *dlopen(const char *file, int mode); RTLD_LAZY Relocations shall be performed at an implementation-defined time, ranging from the time of the dlopen() call until the first reference to a given symbol occurs. Specifying RTLD_LAZY should improve performance on implementations supporting dynamic symbol binding as a process may not refer- ence all of the functions in any given object. And, for systems supporting dynamic symbol resolution for normal process execution, this behavior mimics the normal handling of process execution. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org

On Wed, 15 Aug 2012 13:09:54 -0400 Cristian Rodríguez <crrodriguez@opensuse.org> wrote:
Hi, maybe I do not understand your question correctly, but I think depmod is what you are looking for. kr, Dieter -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org

El 15/08/12 14:05, dieter escribió:
maybe I do not understand your question correctly, but I think depmod is what you are looking for.
something like depmod, yeah, but not in the kernel side and at application runtime... -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org

On Wed, 15 Aug 2012 14:14:17 -0400 Cristian Rodríguez <crrodriguez@opensuse.org> wrote:
sorry, I was confused by "modules". when a library is created the -l parameter is used, e.g. -lfoo for building libbar.so, and -lbar for building libepicfail.so, to tell the linker about its dependencies. Therefore I would think a user of libopenfail does not need to know its dependencies and care about loading them in the correct order. If the libraries foo and bar also use dlopen() to load the libs they depend on they have to do it themselves, and not the application which uses libepicfail.so. At least this is my picture... Dieter -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org

Cristian Rodríguez <crrodriguez@opensuse.org> writes:
From the man page:
void *dlopen(const char *file, int mode); RTLD_LAZY Relocations shall be performed at an implementation-defined time, ranging from the time of the dlopen() call until the first reference to a given symbol occurs. Specifying RTLD_LAZY should improve performance on implementations supporting dynamic symbol binding as a process may not refer- ence all of the functions in any given object. And, for systems supporting dynamic symbol resolution for normal process execution, this behavior mimics the normal handling of process execution. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
participants (3)
-
Cristian Rodríguez
-
dieter
-
Sebastian Freundt