@karlos
You can have this with libraries, too. Of course they have to used different name always.
The accepted practise for .so files on other OS is to use version-based names and symlinks.
supposing you had a library "mystuff" which was version 1, revision 0, you'd generally call it:
libmystuff.so.1.0
Applications which absolutely must have this version/revision (and depending on a specific revision is bad practise anyway) would link against it directly. Thanks to the naming convention, you can have other versions/revisions installed concurrently. Applications which only depend on the major version would use
libmystuff.so.1
where this is
usually a symlink to the actual file which could be any revision number. A library is considered a revision change when none of it's originally exported symbols change. Any changes to the originally exported symbols (or major changes to the behaviour of them) count as a version change.
Applications that actually don't require any specific library version would link against
libmystuff.so
which again is usually a symlink to a specific version/revision (most often the latest one).
But is this different to libraries...? I am developing SDL for MorphOS and when I am trying new AltiVec optimization I only replace old powersdl.library in LIBS: and try different SDL games with it.
It's different to libraries in that you can have multiple concurrent versions/revisions of the library. The AmigaOS method of opening libraries is based on passing the name and a version, where the version is stored in the library itself. You'll always get at least the version asked for (or failure to open otherwise), but possibly a newer one. You can't have V30 and V40 graphics.library available concurrently, for example. OTOH, with .so libraries, I can have libmystuff.2 and libmystuff.1 and applications that depend on each major version can happily coexist. Applications that don't depend on the specific version can all use the newest or oldest version at my choosing - it all depends on which particular specific version I point libmystuff.so at.
Now, you may say (and FWIW, I'd generally agree) that in reality, no newer version of a library should break what an older version does and thus being able to support concurrent versions shouldn't be needed. However, you know as well as I do, that in practise, that often isn't how it pans out.
I havent investigated this topic very much but to my understanding to .so object sharing can not work in a shared address space model. The problem is, as I see it, relocating data sections.
Depends on the OS environment. Shared objects are ELF files at the end of the day and primarily coming from GNU, were designed with unix-like operating systems in mind. A lazy implementation of the linker/loader doesn't need to consider sharing the memory representation between processes because the OS almost certainly gives each process an entirely different address space. However, this does not mean the text (code) segment and data segments cannot be loaded separately by a not so lazy implementation. If the OS allows different processes to share read-only executable memory, it is possible to share that memory region between processes. Their individual memory maps may show that region at different places but the physical address will be the same. Only the writeable data segment of the file will exist in different physical locations, one per process.
Now, for OS4, we have the problem you allude to. How do we create separate instances of the data section? Well, that remains to be seen. It may be that it's never implemented. Or it may be that it is possible if the data segment is always loaded in MEMF_VIRTUAL and some mmu trickery is used.