From owner-freebsd-current Mon Jan 20 08:33:19 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id IAA10228 for current-outgoing; Mon, 20 Jan 1997 08:33:19 -0800 (PST) Received: from austin.polstra.com (austin.polstra.com [206.213.73.10]) by freefall.freebsd.org (8.8.4/8.8.4) with ESMTP id IAA10218; Mon, 20 Jan 1997 08:33:10 -0800 (PST) Received: from austin.polstra.com (jdp@localhost) by austin.polstra.com (8.8.3/8.8.3) with ESMTP id IAA28515; Mon, 20 Jan 1997 08:33:01 -0800 (PST) Message-Id: <199701201633.IAA28515@austin.polstra.com> To: Poul-Henning Kamp cc: Mark Murray , peter@FreeBSD.ORG, current@FreeBSD.ORG Subject: Re: Static binaries and dlopen(3) with a new crypt(3) lib. In-reply-to: Your message of "Mon, 20 Jan 1997 09:32:30 +0100." <11234.853749150@critter.dk.tfs.com> References: <11234.853749150@critter.dk.tfs.com> Date: Mon, 20 Jan 1997 08:33:00 -0800 From: John Polstra Sender: owner-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > >I also want to move the dl* functions out of crt0.o ... > So you would leave the meat of the code in crt0 and just move the > public interface to it ? The meat of the code is already really in the dynamic linker, and the code in crt0 is just an interface to it. At program start-up time, crt0 (with help from the dynamic linker) sets up a struct containing function pointers pointing to the real implementations of dlopen, dlclose, dlsym, and dlerror in the dynamic linker. (That's the required crt0 tie-in that I mentioned.) The public interfaces in crt0 just forward the calls through those function pointers. For example, this is the dlopen code in crt0: void * dlopen(name, mode) char *name; int mode; { if (ld_entry == NULL) return NULL; return (ld_entry->dlopen)(name, mode); } I want to make "ld_entry" a global symbol in the reserved part of the namespace ("_ld_entry" or "__ld_entry"), and then move the interface functions into libc. John -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Self-knowledge is always bad news." -- John Barth