dlsym discussion..

Andy Moreton amoreton@virata.com
Mon Jun 4 02:04:00 GMT 2001

> -----Original Message-----
> From: cygwin-developers-owner@sources.redhat.com
> [ mailto:cygwin-developers-owner@sources.redhat.com]On Behalf Of Robert
> Collins
> Sent: Sunday, June 03, 2001 3:07 PM
> To: cygwin-developers@cygwin.com
> Subject: Re: dlsym discussion..
> ---- Original Message -----
> From: "Christopher Faylor" <cgf@redhat.com>
> > > Thoughts? I'm a bit hesitant at trying to second guess what
> > > dll's have been implicitly loaded by the Win32System, but if
> > > that information is readily available to cygwin, I'm happy to
> > > code up a iterating dlsym().
> >
> > cygwin keeps a list of DLLs loaded via dlopen.  It could register
> > other modules via dll_entry() but that is not a foolproof method
> > due to load order problems.
> BTW: There's no rush on this for me - it doesn't affect what I'm doing -
> I'm just interested in seeing if I can find a way to provide the unix
> dlsym behaviour. Likewise no-one in userland is complaining about this,
> so I hope it won't suddenly become an issue.
> Hmm. Well it seems to me there are two sets of dlls: implicitly loaded
> dll's that we were linked against, and
> "modules"/"plugins"/whateveryouwanttocallthem that get dlopened.
> Both should behave the same, but the key difference is that implicitly
> loaded dll's should be visible to a dlopen(NULL,);dlsym() combination,
> whereas "modules" will give us access to a path name. Thus tracking via
> dlopen()'s isn't likely to provide a comprehensive list.

Looking at this from the Win32 side of things, perhaps you should look at
the ToolHelp library, in particular CreateToolHelp32Snapshot(),
and Module32Next().

This will give you a list of all modules for the current process. Checking
module handle against the list maintained by cygwin should give the
you need.



Virata, Unit 230 Cambridge Science Park, Milton Road, Cambridge CB4 4WB, UK
http://www.virata.com/  Tel: +44 1223 707400  Fax: +44 1223 707447

More information about the Cygwin-developers mailing list