delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/11/02/11:48:27

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Mon, 2 Nov 2009 17:48:07 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Shall dlopen("foo") succeeed if only "foo.dll" exists?
Message-ID: <20091102164807.GA2897@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
MIME-Version: 1.0
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
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

Weird question, right?

Here's the problem.

Assume you have a file "foo.so" on Linux.  If you call

  dlopen ("./foo.so", RTLD_LAZY);

it succeeds, but

  dlopen ("./foo", RTLD_LAZY);

fails because the dlopen function never adds any suffixes like .so
automatically.

Now assume you have a "foo.dll" file on Cygwin.

  dlopen ("./foo.dll", RTLD_LAZY);

succeeds, but so does

  dlopen ("./foo", RTLD_LAZY);

The reason is that Cygwin checks for the .dll suffix as well as the
Windows LoadLibrary function does.

For 1.7 our choice is to keep dlopen() checking for the .dll suffix to
be more Windows-like, or to be more Linux-like by dropping the check for
the .dll suffix so that dlopen() fails if the filename isn't specified
fully.

While we tend to change the implementation to be more Linux-like,
there could be some tools out there which erroneously depend on the
Windows-like behaviour of Cygwin's dlopen().

Does anybody know such a tool?  If so, is there a chance to fix this
easily in that tool or do we have to keep up this behaviour?  Finally,
is there another *good* reason to stick to the Windows-like behaviour
here?


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

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

- Raw text -


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