From: cgf AT cygnus DOT com (Christopher G. Faylor) Subject: Re: dlopen bug! 11 Nov 1998 05:28:20 GMT Message-ID: <72b79k$dvk$1@cronkite.cygnus.com> References: <36481BE9 DOT 35E38846 DOT cygnus DOT gnu-win32 AT uz DOT kuleuven DOT ac DOT be> X-Newsreader: trn 4.0-test63 (15 March 1998) In article <36481BE9 DOT 35E38846 DOT cygnus DOT gnu-win32 AT uz DOT kuleuven DOT ac DOT be>, Jorrit Tyberghein wrote: >Hi, I'm using CygWin B20 on NT4 (SP3) and I think I have found a bug >in dlopen. > >It seems that dlopen always returns the same handle even if used on different >dll libraries. For example, I extended the dlopen example from: > ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/cygb20/misc/ > >to open two dll's instead of only one and added the following lines to the >code: > > void* dll_handle; > void* dll_handle2; > > ... > > dll_handle = dlopen ("first.dll", RTLD_LAZY | RTLD_GLOBAL); > dll_handle2 = dlopen ("second.dll", RTLD_LAZY|RTLD_GLOBAL); > >Although first.dll and second.dll are really two different dll's dll_handle >and dll_handle2 are equal to each other. Changing the RTLD flags to >RTLD_NOW or something else doesn't help either. > >This is a major setback for me as I need to be able to do dlsym() on individual >dll's (the dll's have functions which have the same name so I need to distinguish >by giving the right dll handle). > >Is this a known bug? >Can this be fixed somehow? It may be a bug. As always, we would welcome a patch to fix it. -- cgf AT cygnus DOT com http://www.cygnus.com/