From: eric@tantalus.nrl.navy.mil (Eric Youngdale)
Subject: Re: Old Libc, can it be tossed?
Organization: Naval Research Laboratory
Date: Tue, 5 Jan 1993 22:48:10 GMT

In article <1993Jan5.200835.16902@athena.mit.edu> ss@uucp writes:
>In article <C0E7zB.8xL@ra.nrl.navy.mil> eric@tantalus.nrl.navy.mil (Eric Youngdale) writes:
>
>[very informative background about jump/shared libs]
>
>My only complaint about linux jump/classic shared libraries is the
>difficulty with which the're created, especially the X libs. Right now
>it seems only a handful of people can actually put together
>jump/classic shared libs. I can think of many widget sets that I'd
>love to use but have to forego since I only how to make them static
>(Wcl, Xc, and Xaw3d come to mind). Are we to expect a collection of
>scripts that would automate or semi-automate the process of making
>shared libraries and render making them feasible to the average user?
>I hope so. Right now I know only of ones in the GCC directory on
>tsx-11 which are overly difficult and seem very specific to only the
>libs they were written for.

	You should join the GCC channel :-).  Seriously, over the past month or
so, a new set of tools has been developed which makes the sharable jump-table
library generation pretty foolproof.  You just need to set up a few things in
your Makefile, make the library, and then run two different programs - one to
generate the stub library and a second one to generate the image library
itself.  In general, you should never have to modify the source code for the
library.  These tools have not been publicly released (I think that they have
been announced on the GCC channel, but not on c.o.l) yet because they are still
under development.  I will say that I was able to generate a jumpified version
of the bfd library from gdb-4.6, and then generate a compatible upgrade from
the bfd in gdb-4.7, and all of this with only a minimum amount of effort.  The
upshot is that I believe it now possible to generate jumptable X libraries,
because these tools can handle global data in ways that the old tools could
not.  I would also add that nearly all of the old tools were discared as they
were too complicated (i.e. I could not figure out how to use them :-).  The
jumpified X libraries have not yet been generated because there is no pressing
need for new X libraries at the moment, and there are other technical problems
that need to be addressed.

	Consideration is being given to some form of dynamic linking.  It turns
out that there are many situations that we simply cannot handle properly (some
of which are specified by posix), and the only way to do it correctly is with
some kind of dynamic linking (much of the effort involved in jumpifying the bfd
library was dealing with an issue that would be handled correctly by dynamic
linking).  The lack of this capability has lead to a number of difficult to
find bugs, and there seems to be general agreement on the GCC channel that some
kind of dynamic linking will be in your future.  The only disagreement has
generally been with implementation issues (i.e. PIC/non-PIC, binary bloat,
impact on page sharing and demand loading, etc).  I wrote a prototype version
of dynamic linking (which actually works, btw) over the long weekend and it is
possible that this or some other scheme will eventually be used when building
sharable libraries.  There are compiler issues that need to be resolved before
my prototype is usable for a large scale library (i.e.  libc, X11).

	The dynamic linking prototype can be tested by people - I put it up for
anonymous ftp on Sunday and announced it to the GCC channel, but someone has
already pointed out a fairly subtle issue that needs to be addressed.  If
anyone wants to try this out, drop me an email message.  It does work for Rich
Salz's editlib which I have been using as a guinea pig while doing tool
development.  The tools for generating a non-dynamicly linked library could be
released separately, but they are undergoing quite a bit of change as they are
also used with the dynamicly linked libraries.  I do not recommend that people
try the dynamic linking if they are hot to build some library because a lot of
it is subject to change.

-Eric
-- 
Eric Youngdale
Newsgroups: comp.os.linux