delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/05/28/18:00:10

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Fri, 28 May 2004 17:08:32 -0500 (CDT)
From: Chris Lattner <sabre AT nondot DOT org>
To: cygwin AT cygwin DOT com
Subject: Chaining of libraries with dlsym
Message-ID: <Pine.LNX.4.44.0405281702290.829-100000@nondot.org>
MIME-Version: 1.0

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019