delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/03/21/14:31:04

X-Spam-Check-By: sourceware.org
Subject: Re: dlopen() bug
From: skaller <skaller AT users DOT sourceforge DOT net>
To: Bernhard Loos <bernloos AT web DOT de>
Cc: cygwin AT cygwin DOT com
In-Reply-To: <454999904@web.de>
References: <454999904 AT web DOT de>
Date: Wed, 22 Mar 2006 06:30:48 +1100
Message-Id: <1142969448.9731.59.camel@rosella.wigram>
Mime-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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

On Tue, 2006-03-21 at 19:52 +0100, Bernhard Loos wrote:
> Hello
> 
> Is there any progress in solving the problem mentioned in this thread:
> http://cygwin.com/ml/cygwin/2006-03/msg00274.html ?

The example in that page is bugged and there is no
reason at all to expect it to work.

The mainline ct.c is a C program, it's compiled
as a C program, and so cannot interact with C++
libraries.

The mainline of any body of code using C++ MUST be
compiled as C++. Furthermore you must NOT explicitly
link libstdc++, that is the job of the compiler.

The fact that the example works when libstdc++ is linked
with the mainline simply suggests an implementation artefact
that some startup code is stored in the library and the linker
manages to execute it.

There's no assurance this is actually initialising everything
correctly. Some initialisation may need to be done 'on the
bottom of the stack' and/or before other code, and it is too 
late when a dll is called half way through the program.

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


--
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