From owner-freebsd-ports Mon Feb 15 23:13:32 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA14364 for freebsd-ports-outgoing; Mon, 15 Feb 1999 23:13:32 -0800 (PST) (envelope-from owner-freebsd-ports@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA14359 for ; Mon, 15 Feb 1999 23:13:30 -0800 (PST) (envelope-from jkoshy@FreeBSD.org) From: Joseph Koshy Received: (from jkoshy@localhost) by freefall.freebsd.org (8.9.2/8.9.2) id XAA90050; Mon, 15 Feb 1999 23:13:28 -0800 (PST) (envelope-from jkoshy@FreeBSD.org) Date: Mon, 15 Feb 1999 23:13:28 -0800 (PST) Message-Id: <199902160713.XAA90050@freefall.freebsd.org> X-Mailer: exmh version 2.0.2 2/24/98 To: ports@FreeBSD.ORG Subject: dlsym() and ELF executables Mime-Version: 1.0 Content-Type: text/plain Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Porters, I spent sometime trying to figure out why dlsym() was not working on handles obtained by calling `dlopen(NULL, flags)' -- i.e. on a handle to the ELF executable itself. It turns out that you need to link the final executable with the `-E' option (--export-dynamic) under ELF to allow symbols defined in the executable to become visible to the `dl*' family of routines. This behaviour is not the default for ELF. This wasn't very obvious (at least to me). I was wondering if anyone else had encountered this stumbling block. Do you think it is worth a FAQ entry? Koshy To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message