From owner-freebsd-questions@FreeBSD.ORG Wed Feb 4 19:07:55 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5115516A4CE for ; Wed, 4 Feb 2004 19:07:55 -0800 (PST) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3D05F43D3F for ; Wed, 4 Feb 2004 19:07:54 -0800 (PST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.10/8.12.10) id i1537raE062587; Wed, 4 Feb 2004 21:07:53 -0600 (CST) (envelope-from dan) Date: Wed, 4 Feb 2004 21:07:53 -0600 From: Dan Nelson To: Joe Lewis Message-ID: <20040205030753.GC76684@dan.emsphone.com> References: <52640.207.173.181.72.1075949311.squirrel@email.relia.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52640.207.173.181.72.1075949311.squirrel@email.relia.net> X-OS: FreeBSD 5.2-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.5.1i cc: freebsd-questions@freebsd.org Subject: Re: dlopen() and parent symbols X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2004 03:07:55 -0000 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@allantgroup.com