Date: Mon, 20 Jan 1997 08:33:00 -0800 From: John Polstra <jdp@polstra.com> To: Poul-Henning Kamp <phk@critter.dk.tfs.com> Cc: Mark Murray <mark@grondar.za>, peter@FreeBSD.ORG, current@FreeBSD.ORG Subject: Re: Static binaries and dlopen(3) with a new crypt(3) lib. Message-ID: <199701201633.IAA28515@austin.polstra.com> In-Reply-To: Your message of "Mon, 20 Jan 1997 09:32:30 %2B0100." <11234.853749150@critter.dk.tfs.com> References: <11234.853749150@critter.dk.tfs.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> >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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199701201633.IAA28515>