Subject: weird link required, please help?
To: None <current-users@NetBSD.ORG>
From: Andrew Brown <>
List: current-users
Date: 05/01/1997 13:42:17
[not sure if this is absolutely the most correct forum, but people around
here seem to know lots of stuff :), so...]

i've got two libraries (both called libfoo.a) that implement the same
protocol, but versions 1 and version 2 of said protocol.  and, of course,
to provide the absolute ease of porting, they both have exactly the same
api (eg, functions calls and global variables).

now clearly i can build a program to work with version one and another
to work with version two, but i wanna make one program to do both.

i can, of course, make a "wrapper" that has symbols unique to each library,
such as foo1.o has a function foo1() that calls foo in libfoo.a for version
one of the protocol.  and another one for the other library.

is there any way i can use ld to link libfoo.a with foo1.o into a new
foo1.o with all symbols from libfoo.a stripped, but with symbols from
foo1.o intact?  ...since then i can set up a handful of function pointers
in the main program to use either version one or version two.

|-----< "CODE WARRIOR" >-----| (TheMan)        * "ah!  i see you have the internet                               that goes *ping*!"      * "information is power -- share the wealth."