Tools to modify shared libraries

Marcel Moolenaar marcel at xcllnt.net
Tue Jun 17 10:48:36 PDT 2003


On Tue, Jun 17, 2003 at 01:02:36PM -0400, Alexander Kabaev wrote:
> On Tue, 17 Jun 2003 09:01:41 -0700
> Marcel Moolenaar <marcel at xcllnt.net> wrote:
> 
> > On Tue, Jun 17, 2003 at 08:49:23AM -0700, Joe Kelsey wrote:
> > Linux uses the same linker (GNU ld). Fixing the linker will have the
> > same effect on Linux as it will have on FreeBSD and hence will prevent
> > unnecessary dependencies in Linux libraries to Linux libraries and
> > thus remove the need to patch ELF files in the long run.
> > 
> 
> LD putting a library in DT_NEEDED regardless of whether or not library
> exports any required symbols as long as it appears on command line is a
> feature, not a bug AFAIK.

It's a bug because DT_NEEDED serves the purpose of recording library
dependencies. Any library that does not contribute to symbol resolution
is by definition not a dependency. Hence, its presence in DT_NEEDED
only makes the dependency information wrong. Dependency information
that's wrong is untrustworthy and unreliable and thus unusable. Hence,
a bug. Immediate consequences of broken dependency information is the
increased startup time of shared binaries, the restriction in use of
libraries in cases where they can be used and the obstruction in
replacing libraries with different implementations by possibly causing
artificial conflicts due to unnecessary loading of libraries.

Only explicit user directives should allow adding libraries to DT_NEEDED
regardless of whether there's actually a dependency.

-- 
 Marcel Moolenaar	  USPA: A-39004		 marcel at xcllnt.net


More information about the freebsd-questions mailing list