*BSD News Article 48892


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!swidir.switch.ch!scsing.switch.ch!news.belwue.de!fu-berlin.de!zrz.TU-Berlin.DE!zib-berlin.de!news.tu-chemnitz.de!irz401!uriah.heep!bonnie.heep!not-for-mail
From: j@bonnie.heep.sax.de (J Wunsch)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: object files for shared libraries
Date: 17 Aug 1995 10:53:16 +0200
Organization: Private U**x site, Dresden.
Lines: 34
Message-ID: <40v01s$8u6@bonnie.tcd-dresden.de>
References: <CFS.95Aug16103006@numero1.mat.puc.cl>
Reply-To: joerg_wunsch@uriah.heep.sax.de
NNTP-Posting-Host: 192.109.108.139
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

Cristian Ferretti <cfs@numero1.mat.puc.cl> wrote:

>	I have been looking for shared libraries preparation in lib sources.
>Seems like you should compile with -fpic and -DBSDSHLIB and later link with
>ld -B shareable -o libfoo.so.M.M $(OBJECTS).
>	But sometimes after compiling ld -x -r is run on each object file
>(ld manual says its for striping unexported symbols).
>
>May someone point why and when is this necesary (or if it exists point to the
>documentation)?

I think it's to strip things like the `gcc_compiled' and other unused
information out of the resulting object.  You don't need it, but it
saves space.

>Also if possible, may someone compare FreeBSD shared libraries with other
>unixes implementation? At first they look like the ones in SunOS 4.

LD(1)                   FreeBSD System Manager's Manual                  LD(1)

NAME
     ld - link editor

...
HISTORY
     The shared library model employed by ld appeared first in SunOS 4.0


I think Paul Kranenburg has re-implemented it after the SunOS 4 model.
-- 
cheers, J"org                      private:   joerg_wunsch@uriah.heep.sax.de
                                   http://www.sax.de/~joerg/

Never trust an operating system you don't have sources for. ;-)