Would you mind to leave your comment on this if you have really experienced which relates to the title above? I have tried to make a shared object to be del
Linux does not support delay loading of libraries out of the box but it can easily be implemented using the same mechanism that is used on Windows i.e. by linking against small stub static library which dlopens main shared library on first call to any of it's functions.
You can implement such stub library by hand, via custom script tailored for your project or use Implib.so to generate it automatically:
$ clang bar.c -fPIC -shared -o libbar.so
$ implib-gen.py libbar.so
$ clang foo.c libbar.tramp.S libbar.init.c -o foo