LD Changes To Implicit DSO Linking Update

Richard W.M. Jones rjones at redhat.com
Tue Feb 9 13:56:37 UTC 2010

On Tue, Feb 09, 2010 at 06:55:11AM -0500, Neal Becker wrote:
> Will there we a switch to give me the old behavior?  I might want this for 
> my own legacy code.

I have not tried it, but apparently --as-needed (or from gcc use

           This option affects ELF DT_NEEDED tags for dynamic libraries
           mentioned on the command line after the --as-needed option.
           Normally the linker will add a DT_NEEDED tag for each dynamic
           library mentioned on the command line, regardless of whether the
           library is actually needed or not.  --as-needed causes a DT_NEEDED
           tag to only be emitted for a library that satisfies an undefined
           symbol reference from a regular object file or, if the library is
           not found in the DT_NEEDED lists of other libraries linked up to
           that point, an undefined symbol reference from another dynamic
           library.  --no-as-needed restores the default behaviour.


Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://et.redhat.com/~rjones/libguestfs/
See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html

More information about the devel mailing list