[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Wine MinGW system libraries

On 9/9/21 12:15 AM, Paul Wise wrote:
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.

Right, but we don't have any guarantee that library A will load library B in its constructor routines. In fact, if it's loading library B dynamically, it's probably not doing that.

Reply to: