From owner-freebsd-hackers Fri Jul 21 3: 8:37 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from tepid.osl.fast.no (tepid.osl.fast.no [213.188.9.130]) by hub.freebsd.org (Postfix) with ESMTP id 3331F37B6BA; Fri, 21 Jul 2000 03:08:32 -0700 (PDT) (envelope-from raw@fast.no) Received: from raw.gren.fast.no (fw-oslo.fast.no [213.188.9.129]) by tepid.osl.fast.no (8.9.3/8.9.1) with ESMTP id KAA88631; Fri, 21 Jul 2000 10:09:26 GMT (envelope-from raw@fast.no) Received: (from raw@localhost) by raw.gren.fast.no (8.9.3/8.9.3) id MAA16446; Fri, 21 Jul 2000 12:09:16 +0200 (CEST) (envelope-from raw) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14712.8524.305147.704022@raw.gren.fast.no> Date: Fri, 21 Jul 2000 12:09:16 +0200 (CEST) X-Mailer: VM 6.72 under 21.1 (patch 9) "Canyonlands" XEmacs Lucid From: Raymond Wiker To: freebsd-hackers@freebsd.org, freebsd-stable@freebsd.org Subject: Re: dlopen() and friends from a statically-linked binary? Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > raw : ~ $ gcc dltest.c -o dltest > raw : ~ $ ./dltest > Handle: 0x2805e000, main: 0x0 > Handle: 0x0, main: 0x0 > > [ Note: this seems wrong; according to the manpage for dlsym, the > second call should give the same output as the first. ] Sorry about the confusion... the "main" symbol does not appear to work for this illustration (possibly because it doesn't come from a dynamic library?). If I try with "errno" instead, I get raw : ~ $ ./dltest Handle: 0x2805e000, errno: 0x280f5cd4 Handle: 0x0, errno: 0x0 raw : ~ $ --- according to the manpage for dlsym(), passing 0 for handle should have the same effect as passing 0 as the path to dlopen; i.e, to access the symbol table for the running program. -- Raymond Wiker To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message