I have done a bit of research and I saw several answers here on SO, including this and this.
I do understand the process of creating a Shared Object actually merges all the various sources and resolves all internal links; it is thus impossible to separate the various pieces that have already been merged together.
What does prevent making a static lib composed by just one module?
I do understand I would lose capability to link "just what needed" and pulling in even a single function would result in inclusion of the whole thing, but I can live with that.
Reason why I ask is I need to produce a wrapper for a Shared lib and, if done normally, this would mean I need to distribute two shared libs: the original one and my wrapper. This has several nasty effects in my environment because i dynamically load my wrapper in final program and thus I can place it wherever I want, while "original" Shared lib is searched independently and I have a lot of troubles to have dynamic loader to find it in the general case.
If I manage to convert original Shared into a Static lib then linking my wrapper to it would pull it in and I would have an "all inclusive" wrapper.
I did not find any way to obtain this result without recompiling the original lib (which might not be an option in near future).
Either modifying "original lib" to become static (possibly as single object) or instructing linker for my wrapper to "pull shared object in, somehow" would solve my problem.