dlopen() and parent symbols

Dan Nelson dnelson at allantgroup.com
Wed Feb 4 19:07:55 PST 2004


In the last episode (Feb 04), Joe Lewis said:
> I've read that I can't export symbols from the parent executable to
> modules opened with dlopen().  So, I have a (hopefully) quick
> question.  How can I export function(s) to those modules?

ld --export-dynamic?

  -E
  --export-dynamic
     When creating a dynamically linked executable, add all  symbols  to
     the  dynamic  symbol table.  The dynamic symbol table is the set of
     symbols which are visible from dynamic objects at run time.

     If you do not use this option, the dynamic symbol table  will  nor-
     mally  contain  only  those  symbols  which  are referenced by some
     dynamic object mentioned in the link.

     If you use "dlopen" to load a dynamic object which needs  to  refer
     back  to the symbols defined by the program, rather than some other
     dynamic object, then you will probably need to use this option when
     linking the program itself.



-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-questions mailing list