Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Feb 1999 23:13:28 -0800 (PST)
From:      Joseph Koshy <jkoshy@FreeBSD.ORG>
To:        ports@FreeBSD.ORG
Subject:   dlsym() and ELF executables
Message-ID:  <199902160713.XAA90050@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help


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
<jkoshy@freebsd.org>



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199902160713.XAA90050>