From 75effa37fcb63c1e72918f6689660e4c3b11a5e8 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 5 Mar 2012 10:27:44 +0000 Subject: [PATCH] * dll_init.cc (dll_list::operator[]): Extend comment a bit more to explain previous patch. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/dll_init.cc | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index af6b079e6..36347c950 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2012-03-05 Corinna Vinschen + + * dll_init.cc (dll_list::operator[]): Extend comment a bit more to + explain previous patch. + 2012-03-04 Corinna Vinschen * dll_init.cc (dll_list::alloc): Compare linked DLLs by basename only. diff --git a/winsup/cygwin/dll_init.cc b/winsup/cygwin/dll_init.cc index 170cf84e0..3b358d5a0 100644 --- a/winsup/cygwin/dll_init.cc +++ b/winsup/cygwin/dll_init.cc @@ -131,7 +131,22 @@ dll::init () So I reverted the original change from 2012-02-08 and only applied the following fix: Check if the path is preceeded by a long pathname prefix, and, if so, drop it forthwith so that subsequent full path comparisons - work as expected. */ + work as expected. + + At least that was the original idea. In fact there are two case, linked + and runtime loaded DLLs, which have to be distinguished: + + - Linked DLLs are loaded by only specifying the basename of the DLL and + searching it using the system DLL search order as given in the + aforementioned MSDN URL. + + - Runtime loaded DLLs are specified with the full path since that's how + dlopen works. + + In effect, we have to be careful not to mix linked and loaded DLLs. + For more info how this gets accomplished, see the comments at the start + of dll_list::alloc, as well as the comment preceeding the definition of + the in_load_after_fork bool later in the file. */ dll * dll_list::operator[] (const PWCHAR name) {