From f6657d0434f7df29bf99aadaa32a01effb87ec85 Mon Sep 17 00:00:00 2001 From: Joseph Koshy <jkoshy@FreeBSD.org> Date: Wed, 17 Feb 1999 03:08:21 +0000 Subject: [PATCH] Added an entry on the need for linking with -export-dynamic for dlopen(NULL, flags) to be useful. --- FAQ/hackers.sgml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/FAQ/hackers.sgml b/FAQ/hackers.sgml index 0d1bdd4417..197f42dce4 100644 --- a/FAQ/hackers.sgml +++ b/FAQ/hackers.sgml @@ -1,4 +1,4 @@ -<!-- $Id: hackers.sgml,v 1.11 1999-01-21 01:49:12 jkh Exp $ --> +<!-- $Id: hackers.sgml,v 1.12 1999-02-17 03:08:21 jkoshy Exp $ --> <!-- The FreeBSD Documentation Project --> <sect> @@ -487,4 +487,19 @@ Cc: current@FreeBSD.ORG phase. If it does, type 'continue' and it will finish the crash dump." -ed]</em> + <sect1> + <heading>dlsym() stopped working for ELF executables!</heading> + + <p>The ELF toolchain does not, by default, make the symbols + defined in an executable visible to the dynamic linker. + Consequently <tt>dlsym()</tt> searches on handles obtained + from calls to <tt>dlopen(NULL, flags)</tt> will fail to find + such symbols. + + <p>If you want to search, using <tt>dlsym()</tt>, for symbols + present in the main executable of a process, you need to link + the executable using the <tt>-export-dynamic</tt> option to the + <htmlurl url="http://www.freebsd.org/cgi/man.cgi?ld" + name="ELF linker">. + </sect>