*BSD News Article 58095


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!nntp.coast.net!news.sprintlink.net!news.nynexst.com!gnu.ai.mit.edu!hjl
From: hjl@gnu.ai.mit.edu (H.J. Lu)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: ELF
Date: 26 Dec 1995 00:19:25 GMT
Organization: Ooops
Lines: 46
Message-ID: <4bnf2d$lhr@news.nynexst.com>
References: <4avq5m$7rk@complete.org> <4bghlm$7q3@pell.pell.chi.il.us> <4bn4i7$g0j@helena.MT.net>
NNTP-Posting-Host: nomad12.nynexst.com

In article <4bn4i7$g0j@helena.MT.net>, nate@trout.sri.MT.net (Nate Williams) writes:
|> In article <4bghlm$7q3@pell.pell.chi.il.us>, Orc <orc@pell.chi.il.us> wrote:
|> [ What is ELF? ]
|> 
|> >   It's a different executable format, to bite us Linux users who
|> >have foolishly kept old binaries around.  It's supposed to make
|> >creating mountains of shared libraries easy, and this Linux user
|> >hopes that FreeBSD won't convert to it because easy to make shared
|> >libraries may lead to a MS-Windows like proliferation of them.
|> 
|> The funny thing is that building shlibs under FreeBSD has been simple
|> from day one.  We already went through the 'everything should be a
|> shlib' growing pain already, and are now only making libraries shared
|> which (we think) make sense to be shared.
|> 
|> Many folks in the Linux camp love ELF mainly for this feature (since
|> none of the other advantage of ELF are usable yet) and have been trying

I am not sure what you meant by not usable yet. The Linux ELF
implementation is trying to be 100% compatible with SVR4 if
possible. We added some extensions to our ELF. There are also
somethings on our wish list :-(.

One thing I like and use is DT_RPATH. I can install a shared
library in a non-standard location without changing any system
files and only the prorams linked with it using DT_RPATH will
know where to find it. I used it to build a shared gcc backend
library which could only be found by cc1/cc1plus/cc1obj. The
speed was about 9% slower, but the binary size was reduced by
40-50%. With DT_RPTAH and DT_SONAME, I don't have to worry too
much if cc1 will pick up a wrong gcc backend.

|> to convert the BSD's to it because of the ease of building shlib, never
|> realizing the the BSD implemention *always* made it easy to build them.
|> 
|> As a matter of fact, the command line parameters are almost *exactly*
|> the same.  You could write a Makefile that was portable to both OS's to
|> build shared libraries fairly trivially.
|> 

I am not sure if that is true for building the shared C++ library.
Under ELF, you don't have to do anything special to your C++ source
to make file-scope constructors/destructors work with shared library.
They even work with dlopen/dlclose.

H.J.