PLEX86  x86- Virtual Machine (VM) Program
 Plex86  |  CVS  |  Mailing List  |  Download  |  Linux  |  Newsgroups

lazy loading of a shared library 4633


Your Ad Here

Your Ad Here

This kind of thing is generally programmed into the application, not "told to the system". Linking is something specified by the author of the software, and he may specify that the process is completed at runtime in various ways. Two of the most common are "done at compiletime, not at runtime at all", and "done at program startup". However, he can also specify EXACTLY when he wants the linking of a particular symbol to be done, and WHERE it should be looked for, among other things.

And I may add, the behaviour you inquire about - "load a shared library only when the first call is made" - is the DEFAULT behaviour on linux. Man ld.so. Eager loading is not the default.

Anything is possible.

This is a linker option, so you are linking, not "telling the system" anything. Hmmm.

Since you are the author, you may program linkage to occur at ANY point for ANY symbol. Man dlsym.

From man ld.so:

LDBINDNOW If present, causes the dynamic linker to resolve all symbols at program startup instead of when they are first referenced.

Deep linker magic needed!

I would imagine that you want to use dlopen() against your intended library, with flag RTLDLAZY, and do explicit dlsym() calls for your target symbols exactly when you want them.

lazy loading of a shared library 4634
I suspect that is an artifact of the way it is run or linked in ... probably the C runtime envirnment (crt0.o, or whatever) is responsible via calling the init() routine of each shared...

Peter



Your Ad Here

List | Previous | Next

lazy loading of a shared library 4634

Linux groups from Newsgroups

The #1 Usenet Provider on the Internet

Which distro for pc with no CD Drive