Subject: Re: CVS commit: pkgsrc
To: Chris G. Demetriou <cgd@sibyte.com>
From: Greg A. Woods <woods@weird.com>
List: source-changes
Date: 09/28/2000 08:39:08
[ On , September 27, 2000 at 20:02:24 (-0700), Chris G. Demetriou wrote: ]
> Subject: Re: CVS commit: pkgsrc
>
> Bill Studenmund <wrstuden@zembu.com> writes:
> > No. What I was saying (and I'm sorry if it came out wrong) is this: say I
> > have a library which needs another library for some of its routines. If I
> > link in  this library, but don't use any of the routines which need that
> > other library, why does the program need to have it linked in (or have its
> > absense be an error)?
> 
> "that is the way of ELF shared libraries."

That was, unfortunately, the way of NetBSD's a.out shared libraries too,
but was not true on other similar systems, eg. SunOS-4.

As far as I can see it does not have to be true either.  The linker need
not register all libraries listed on the command line -- only those
libraries which have been used to resolve symbols need to be registered
in the final binary.

> ELF shared libraries should link against all libraries that any of the
> routines that they contain depend on.

Specifying an uneeded library (i.e. one which is not used to resolve any
symbols) on the link command line should not ever cause a run-time
error if that library is not available in the run-time environment.

-- 
							Greg A. Woods

+1 416 218-0098      VE3TCP      <gwoods@acm.org>      <robohack!woods>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>