public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Chaining of libraries with dlsym
@ 2004-05-29  0:36 Chris Lattner
  0 siblings, 0 replies; only message in thread
From: Chris Lattner @ 2004-05-29  0:36 UTC (permalink / raw)
  To: cygwin


I'm having a problem using the cygwin implemementation of dlsym.  I am
porting the LLVM JIT to Win32 using Cygwin.  Just about everything works
great (major thanks for all your work!), but dlsym works differently on
unix and cygwin.

In particular, the LLVM JIT likes to look up symbols in its own process
space to resolve symbols it doesn't know about.  For example, if the
program calls printf, it would do:

  void *FP = dlsym(0, "printf");

... and the function would directly call the function.  This doesn't work
on cygwin, so I looked in dlfcn.cc.  Changing the code in the JIT to this:

void *M = dlopen(0, X);
void *FP = dlsym(M, "printf");

Doesn't work either.  I think the problem is that printf isn't defined in
the main executable, it's probably defined in a library, which isn't being
search by GetProcAddress.

Does anyone know of a solution to this problem?  Anything from fixing
cygwin to suggesting a work-around would be very welcome.

Thanks again for such a great tool!

-Chris

-- 
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-05-28 21:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-29  0:36 Chaining of libraries with dlsym Chris Lattner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).