From owner-freebsd-current@FreeBSD.ORG Sat Jun 19 16:44:19 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1BBA216A4CE for ; Sat, 19 Jun 2004 16:44:19 +0000 (GMT) Received: from meitner.wh.uni-dortmund.de (meitner.wh.Uni-Dortmund.DE [129.217.129.133]) by mx1.FreeBSD.org (Postfix) with ESMTP id A2F0E43D31 for ; Sat, 19 Jun 2004 16:44:18 +0000 (GMT) (envelope-from michaelnottebrock@gmx.net) Received: from lofi.dyndns.org (pc2-105.intern.meitner [10.3.12.105]) by meitner.wh.uni-dortmund.de (Postfix) with ESMTP id 07BF31675A8; Sat, 19 Jun 2004 18:43:37 +0200 (CEST) Received: from kiste.my.domain (kiste.my.domain [192.168.8.4]) (authenticated bits=0) by lofi.dyndns.org (8.12.10/8.12.10) with ESMTP id i5JGhWxm018506 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Sat, 19 Jun 2004 18:43:32 +0200 (CEST) (envelope-from michaelnottebrock@gmx.net) From: Michael Nottebrock To: freebsd-current@FreeBSD.org Date: Sat, 19 Jun 2004 18:43:26 +0200 User-Agent: KMail/1.6.2 References: <200406191820.26499.michaelnottebrock@gmx.net> In-Reply-To: <200406191820.26499.michaelnottebrock@gmx.net> MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Boundary-03=_u0G1A7ly03yeISI"; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200406191843.26708.michaelnottebrock@gmx.net> X-Virus-Scanned: by amavisd-new cc: Frerich Raabe Subject: Re: dlclose problem X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2004 16:44:19 -0000 --Boundary-03=_u0G1A7ly03yeISI Content-Type: multipart/mixed; boundary="Boundary-01=_u0G1A6Log3OeQZZ" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_u0G1A6Log3OeQZZ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday 19 June 2004 18:20, Michael Nottebrock wrote: > Attached is a small testcase made by Frerich Raabe=20 Since the mailinglist strips tarballs, here is the case uncompressed. =2D-=20 ,_, | Michael Nottebrock | lofi@freebsd.org (/^ ^\) | FreeBSD - The Power to Serve | http://www.freebsd.org \u/ | K Desktop Environment on FreeBSD | http://freebsd.kde.org --Boundary-01=_u0G1A6Log3OeQZZ Content-Type: text/plain; charset="iso-8859-1"; name="Makefile" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="Makefile" all: plugin.o dltest clean: rm -f dltest plugin.o plugin.o: g++ -shared -o plugin.o plugin.cc dltest: g++ -Wl,--export-dynamic -o dltest dltest.cc --Boundary-01=_u0G1A6Log3OeQZZ Content-Type: text/plain; charset="iso-8859-1"; name="dltest.cc" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="dltest.cc" #include #include using namespace std; int main() { typedef void( *PluginFunction )(); void *pluginHandle = dlopen( "./plugin.o", RTLD_LAZY ); if ( !pluginHandle ) { cerr << dlerror() << endl; return 1; } PluginFunction pluginFunction = ( PluginFunction )dlsym( pluginHandle, "entry" ); const char *error = dlerror(); if ( error ) { cerr << error << endl; return 1; } pluginFunction(); dlclose( pluginHandle ); } --Boundary-01=_u0G1A6Log3OeQZZ Content-Type: text/plain; charset="iso-8859-1"; name="plugin.cc" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="plugin.cc" #include #include using namespace std; extern "C" { void entry() { static std::string s; s = "Hi"; cout << "Plugin says " << s << endl; } } --Boundary-01=_u0G1A6Log3OeQZZ-- --Boundary-03=_u0G1A7ly03yeISI Content-Type: application/pgp-signature Content-Description: signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQBA1G0uXhc68WspdLARAl2/AJ9/GXriMeBeooazWxQRFh2gKsXErgCfZed3 nrB9zIHrZBplPlwI/yXFBkM= =H5Bd -----END PGP SIGNATURE----- --Boundary-03=_u0G1A7ly03yeISI--