Ove Kaaven wrote:
[snip]
> Oh yeah, I should just write another complete ELF loader... yeah sure...
Tsk... No, of course not in that way. Now you have both builtin and
elfdll loader calling ELFDLL_dlopen(). I suggest merely to change this
into:
BUILTIN_dlopen("target.dll", ...)
{
...
ELF_do_dlopen("libtarget.so", RTLD_LAZY|RTLD_GLOBAL);
...
}
ELFDLL_dlopen("target.dll", ...)
{
...
ELF_do_dlopen("target.so", RTLD_NOW);
...
}
Where ELF_do_dlopen() will search the EXTRA_LD_LIBRARY_PATH for you.
> > Using the RTLD_LAZY flag is a speedup in all cases, but a nasty
> > bug-causer when we talk about binary versions because it will be
> > detected too late in the execution. It is much better to get rid of the
> > dependencies. These have to go anyway. Why not start with them now? A
> > much cleaner fix anyway.
>
> I beg you pardon? The RTLD_LAZY and removing the dependencies aren't
> opposites, removing the dependencies *needs* RTLD_LAZY, that's why I'm
> proposing it, to make removing the dependencies *possible*! If you use
> RTLD_NOW, you *can't* remove the ELF dependencies, since then the dlopen()
> will fail when trying to resolve libraries that Wine hasn't loaded yet.
>
> Wine can only know that it should load those libraries after it has loaded
> the main library and get a chance to look at its DLL descriptor's import
> list. Then Wine can load those DLLs (with RTLD_GLOBAL); the symbols are
> then able to resolve lazily when the DLL is used, but resolving them
> before Wine could do that would be too early and would fail when we remove
> the dependencies.
I am not saying that they are opposites, but merely that you should be
extremely cautious. That is why I suggest to split that part. Elflls
should fail immediately if the dependencies are not resolved to ensure
isolation. Moreover, they cannot have the RTLD_GLOBAL flag set because
they possibly share identical symbols with different meaning/destination
(you cannot use ELF-linking against elfdlls).
Removing the dependencies does not necessarily imply RTLD_LAZY. This can
be prevented if the target is linked against the dependent .so-libraries
*and* they are in the LD_LIBRARY_PATH or ld.so.conf. I prefer to set
LD_LIBRARY_PATH prior to wine startup to make sure that I can load the
dependencies. This scenario does not require RTLD_LAZY.
[snip]
> What is? I am unable to see what exactly you are proposing...
See above.
Greetings Bertho
PS, it is unlikely that I will be finishing elfdlls before september. I
am pressed very hard at the moment to finish my thesis (should have been
finished last March). So, major things will have to wait a moment.