On Wed, 2021-09-08 at 23:47 -0500, Zebediah Figura wrote: > Unfortunately, while thinking about the answer to this question, I > realized another snag, which I think really does make using > identically-named dynamic libraries impossible: if system library A > loads system library B dynamically, i.e. does the equivalent of a > dlopen(), we have no way of knowing which namespace to apply to it. > [AFAICT dlmopen() has this problem too, and just isn't meant for that > use case.] Even rewriting the import table doesn't help here.
While loading library A into a namespace Foo, the loader could set a process global variable containing the current namespace to load into, and then have the dlopen equivalent use namespace Foo in preference to the default namespace for the process. Then when library B is loaded it will go into namespace Foo. Once loading library B and A has completed the loader could revert to using the default namespace. -- bye, pabs https://wiki.debian.org/PaulWise
signature.asc
Description: This is a digitally signed message part