Originally posted by tildearrow
View Post
The reality is the ELF format does not mandate everything in a global namespace this is way dlmopen works. Reality with ELF you can have a many namespaces as you like as long as the ELF dynamic loader plays ball. Solaris ELF loader could avoid the symbol conflict.
Solaris app->gtk2->libfoo->gtk3->no symbol conflict and its a ELF system if you build with the right flags. What those flags have added is STT_FIle entries into the ELF dynamic loader table and the Solaris dynamic loader takes the existence of this to perform Segregated Dynamic Linking. Linux libc dynamic loaders don't have this be it glibc or musl.
Yet there is a funny one Linux app->gtk2->libfoo->libfoo->gtk3 no symbol conflict.
That libfoo typed twice is not a mistake. If you have made a libcapsule version of the library it works. Yes the first libfoo is a shim using ufunc and dlmopen.
The reality is the ELF loaders on Linux are quite feature poor.
Yes the libcapsule work done 2017/2018 found that the belief that ELF had to be a single global namespace was not true. Single global namespace is the lazy way to implement a elf loader. PE format does in fact have cases where its used only with a single global namespace as well fun of different UEFI implementations.
Yes glibc elf loader today with dlmopen does support multi namespaces. But we still cannot do a build flag to say these imports come from X libraries must be in different namespace so you must use wrapper libraries.
The reality of libcapsule it would be possible for appimage to contain a stack of proxy libraries that could process a xattr/environmental var on the program to say where to find the runtime. So allowing independent runtime to system to be installed.
The single global namespace of elf is a lie as a limitation of the design. Elf design support multi namespaces just the common elf loaders default to using only one even when they support multi-able so causing hell. Yes PE onwindows yes it also does segregated loading but when you get into UEFI the UEFI loader PE can be simplified the same way as the glibc/musl ELF loaders on Linux leading to the same cases of symbol conflict.
Leave a comment: