+1  A: 

See the reference on your system for dlopen(). You can manually open libraries and resolve external symbols at runtime rather than at link time.

Dug out an example:

int main(int argc, char **argv) {                 
    void *handle=NULL;                                 
    double (*myfunc)(double);                     
    char *err=NULL;                                  

    handle = dlopen ("/lib/libm.so.1", RTLD_LAZY);
    if (!handle) {                                
        err=dlerror();
        perror(err);
        exit(1);                                  
    }                                             

    myfunc = dlsym(handle, "sin");                
    if ((err = dlerror()) != NULL)  {           
        perror(err);
        exit(1);                                  
    }                                             

    printf("sin of 1 is:%f\n", (*myfunc)(1.));              
    dlclose(handle);            
    return 0;                  
}                                                 
jim mcnamara
Thanks. But it would be better if I can specify the Delay load equivalent option in linker instead of using dlopen. Is there not any option in GCC to lazy load the libxxx.so file?.Can we not use gcc -WI to pass the lazy load options to set the linker for lazy load?. will the linker set default to the lazy load?. Please help me.Thanks in advance
saran
pra