Added an entry on the need for linking with -export-dynamic for

dlopen(NULL, flags) to be useful.
This commit is contained in:
Joseph Koshy 1999-02-17 03:08:21 +00:00
parent 17c8e7e183
commit f6657d0434
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=4344

View file

@ -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>