From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 16 12:33:13 2006 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4D4AB16A4DD for ; Sun, 16 Jul 2006 12:33:13 +0000 (UTC) (envelope-from corecode@fs.ei.tum.de) Received: from stella.fs.ei.tum.de (stella.fs.ei.tum.de [129.187.54.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 96C5443D49 for ; Sun, 16 Jul 2006 12:33:10 +0000 (GMT) (envelope-from corecode@fs.ei.tum.de) Received: from localhost (localhost [127.0.0.1]) by localhost.fs.ei.tum.de (Postfix) with ESMTP id B611C8CE52; Sun, 16 Jul 2006 14:33:08 +0200 (CEST) Received: from stella.fs.ei.tum.de ([127.0.0.1]) by localhost (stella [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 27772-03; Sun, 16 Jul 2006 14:33:07 +0200 (CEST) Received: from [84.155.210.132] (p549BD284.dip.t-dialin.net [84.155.210.132]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by stella.fs.ei.tum.de (Postfix) with ESMTP id 7F1DE8C5EE; Sun, 16 Jul 2006 14:33:07 +0200 (CEST) Message-ID: <44BA31FE.7070200@fs.ei.tum.de> Date: Sun, 16 Jul 2006 14:33:02 +0200 From: Simon 'corecode' Schubert User-Agent: Mail/News 1.5.0.4 (X11/20060619) MIME-Version: 1.0 To: Roland Dittel References: <62d3f75eb4400604406fdea341d91e41@web.de> <44B92FD7.90801@fs.ei.tum.de> <44BA1B7B.8000305@web.de> In-Reply-To: <44BA1B7B.8000305@web.de> X-Enigmail-Version: 0.94.0.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigA86F4B6AFFC8D6C383C08255" X-Virus-Scanned: by amavisd-new at fs.ei.tum.de Cc: hackers@freebsd.org Subject: Re: dlsym() on implicit loaded symbols X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jul 2006 12:33:13 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigA86F4B6AFFC8D6C383C08255 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Roland Dittel wrote: >>> We have a issue with dlsym() on symbols imported by a library that=20 >>> was loaded with dlopen(). Our code loads the libssl with dlopen() and= =20 >>> then do a dlsym() on several symbols. This works for all symbols=20 >>> exported by libssl itself but fails for symbols exported by=20 >>> libcrypto. [..] > func =3D dlsym(handle, "CRYPTO_set_id_callback"); you have to use RTLD_DEFAULT instead of handle, but I agree, this is not = in conformance with SUSv3: The dlsym() function shall search for the named symbol in all objects= loaded automatically as a result of loading the object referenced by han= dle (see dlopen()). Load ordering is used in dlsym() operations upon the = global symbol object. The symbol resolution algorithm used shall be depen= dency order as described in dlopen(). The RTLD_DEFAULT and RTLD_NEXT flags are reserved for future use. Note "in all objects loaded automatically". Good catch! cheers simon --=20 Serve - BSD +++ RENT this banner advert +++ ASCII Ribbon /"\ Work - Mac +++ space for low =E2=82=AC=E2=82=AC=E2=82=AC NOW!1 +++= Campaign \ / Party Enjoy Relax | http://dragonflybsd.org Against HTML \ Dude 2c 2 the max ! http://golden-apple.biz Mail + News / \ --------------enigA86F4B6AFFC8D6C383C08255 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (DragonFly) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEujICr5S+dk6z85oRArhwAKD2xn+pZ4sAuX1YkdrSFO9YXcnS8wCeMtDj 0RWwEay+/rO+NIo8EQXiux8= =GCni -----END PGP SIGNATURE----- --------------enigA86F4B6AFFC8D6C383C08255--