*BSD News Article 2713


Return to BSD News archive

Path: sserve!manuel!munnari.oz.au!spool.mu.edu!sgiblab!sdd.hp.com!wupost!uunet!mcsun!Germany.EU.net!gmdtub!bigfoot!tmh
From: tmh@doppel.first.gmd.de (Thomas Hoberg)
Newsgroups: comp.unix.bsd
Subject: Re: 386BSD: Anyone using gcc-2.x on 0.1?
Message-ID: <TMH.92Jul29235202@doppel.first.gmd.de>
Date: 29 Jul 92 21:52:02 GMT
Article-I.D.: doppel.TMH.92Jul29235202
References: <1992Jul29.155631.21213@thyme.jpl.nasa.gov> <Bs5vBy.3Cp@unx.sas.com>
Sender: news@bigfoot.first.gmd.de
Organization: GMD-FIRST, Berlin
Lines: 35
In-reply-to: sastdr@torpid.unx.sas.com's message of 29 Jul 92 17:31:10 GMT

In article <Bs5vBy.3Cp@unx.sas.com> sastdr@torpid.unx.sas.com (Thomas David Rivers) writes:

   I'm not sure that v 2.2.x is a pre-requisite for shared libraries; I
   ran for a long time w/ 1.38 & 1.39 on ISC unix and was able to build
   shared libraries fine.  You may want to look there and see how they
   did it...  (The original X11R4 done by Thomas Roell was a shared library
   built with gcc 1.38).

There are (at least) two differnt kinds of shared libs. ISC loads
shared libs at fixed virtual addresses, so the fixup is resolved at
link time (=linking with the stub library). For GCC there is no
difference there between libraries linked in and libraries loaded at
run-time. From the software developers point of view there is a bit of
overhead involved creating the shared libraries via mkshlib. (That is
THE reason why nobody has yet volunteered to do the shared libs for
X11R5--it's a lot of work and not everybody feels like doing that kind
of work for free (not even Thomas Roell anymore)). SunOS and others
use a different kind of "shared library" that is they do run-time
binding of addresses. Since a complete linking pass at run-time would
be quite expensive (and might require multiple passes of the
executable) shared library code is coded differently "position
independent", so that calls within the library don't have to be
recalculated or fixed up again. That would also make them not
shareable, since it would be application dependent. I am not sure on
the details, but I believe run-time linking can be done in a single
pass and only involves fix-ups in the code that uses the library not
the library itsself.

Hope I didn't muddy things further or made an ass of myself :-)
---
Thomas M. Hoberg   | Internet: tmh@first.gmd.de
1000 Berlin 41     |           tmh@cs.tu-berlin.de
Wielandstr. 4      |
Germany            | BITNET:   tmh@tub.bitnet 
+49-30-851-50-21   |