On Jun 28 23:45, Thomas Wolff wrote:
Am 28.06.2011 23:36, schrieb Ryan Johnson:
On Jun 28 22:36, Thomas Wolff wrote:
Can't cygwin compilation ensure that the cygwin1.dll is always
loaded first so it could take care of this (if only by then adding
to the path)?
(I guess the answer may be no because Windows is juggling with
the DLLs...)
[...]
The answer is definitely "no." Windows can map dlls in any order
it pleases, and is only semi-required to initialize them in
dependency order (because dlls are often circular dependent
anyway). In particular, dlls which suffer base address collisions
tend to be loaded before cygwin1.dll
Last feable attempt: So why does cygwin have to let Windows load the
DLLs at all? Couldn't the programs just have a stub that uses a
dedicated version of dlopen for dynamic linking?
In theory, yes. Every libfoo.dll.a would have to point back to Cygwin
and Cygwin could call LoadLibrary/GetProcAddress so that there's no
explicit load-time linking anymore as far as Cywin DLLs are concerned.
That requires support by gcc/binutils/libtool(?) when building shared
libs, though.