Subject: Re: RFC: migration to a fully dynamically linked system
To: Wolfgang Solfrank <ws@tools.de>
From: Todd Vierling <tv@wasabisystems.com>
List: tech-userlevel
Date: 01/05/2002 00:08:48
On Sat, 5 Jan 2002, Wolfgang Solfrank wrote:

: > Compile ashared object that writes to stdout, then use that library from a
: > program that also writes to stdout.  Finally, link the program against both
: > the dynamic library above, and /usr/lib/libc.a (the statically linked
: > version of libc).
: >
: > You should end up with a binary using one __sF[], and a library using
: > entirely another.
:
: Hmm, did you actually try this?  I just did, and it worked like a charm.
: I.e. both the main program and the dlopen()ed library function used the
: same __sF[].

Then it's porbably likely that ld(1) picked the dynamic libc over the static
one.  Linking the library against -lc as a dependency, and then linking the
program -nostdlib with crt0, libc.a, and libgcc.a (simulating static linking
on a dynamic program), should do what I'm talking about.  In particular, the
resultant binary should contain a data symbol for __sF, meaning that the
binary has __sF inside it (rather than depending on the shared libc's).

-- 
-- Todd Vierling <tv@wasabisystems.com>  *  Wasabi & NetBSD:  Run with it.
-- CDs, Integration, Embedding, Support -- http://www.wasabisystems.com/