Subject: Re: HEADS UP: migration to fully dynamic linked "base" system
To: Johnny Billquist <bqt@update.uu.se>
From: Jason R Thorpe <thorpej@wasabisystems.com>
List: current-users
Date: 08/26/2002 11:50:52
On Mon, Aug 26, 2002 at 08:34:54PM +0200, Johnny Billquist wrote:

 > However, what's preventing us from writing a separate dlopen() function
 > that can live in the statically linked binary?

The guts of dlopen() are implemented inside the ELF dynamic linker.  You
would essentially be reimplemeting the ELF dynamic linker in order to do
this.

There's another problem, as well...

Say you have a dynamic shared object which uses strcasecmp(), which is
in libc.  If your static program does not use strcasecmp() (all of the
symbols in the program would have to be exported in such a way as so
dlopen() could find them and provide linkage to them), then the DSO is
stuck -- it would have to map another copy of libc.so in order to
function.

Basically, "solving" this problem with a static-capable dlopen() actually
creates a whole new class of problems which are simply avoided by just
using a dynamically-linked program to begin with.

-- 
        -- Jason R. Thorpe <thorpej@wasabisystems.com>