Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hierarchical ldd(1)

Due to using Gentoo, it often happens that after an update programs are linked against old versions of libraries. Normally, revdep-rebuild helps resolving that, but this time it's a dependency on a python library, and python-updater won't pick it up.

Is there a "hierarchical" variant of ldd which shows me what shared library depends on which another shared library? Most of the time libraries and executables are linked only against a handful of other shared libraries, which in turn were linked against a handful, turning the library dependency into a big list. I want to know which dependency I've got to rebuild with the new version of another library that I upgraded.

like image 207
Astro Avatar asked Sep 28 '09 18:09

Astro


People also ask

What does ldd output mean?

DESCRIPTION top. ldd prints the shared objects (shared libraries) required by each program or shared object specified on the command line. An example of its use and output is the following: $ ldd /bin/ls linux-vdso.

What is ldd used for?

What is Ldd. Ldd is a powerful command-line tool that allows users to view an executable file's shared object dependencies. A library refers to one or more pre-compiled resources such as functions, subroutines, classes, or values. Each of these resources is combined to create libraries.

Does ldd show recursive dependencies?

According to this answer ldd shows all dynamic libraries required for a given binary to run the application. This includes the transitive dependencies you are asking for.

Does ldd shows statically linked?

c++ - ldd outputs statically linked on a shared library - Stack Overflow. Stack Overflow for Teams – Start collaborating and sharing organizational knowledge.


1 Answers

I see many interesting details but no direct answer to the question asked.

The 'hierarchical' version of ldd is lddtree (from app-misc/pax-utils):

$ lddtree /usr/bin/xmllint  xmllint => /usr/bin/xmllint (interpreter => /lib64/ld-linux-x86-64.so.2)     libreadline.so.6 => /lib64/libreadline.so.6         libncurses.so.5 => /lib64/libncurses.so.5             libdl.so.2 => /lib64/libdl.so.2     libxml2.so.2 => /usr/lib64/libxml2.so.2         libicui18n.so.49 => /usr/lib64/libicui18n.so.49             libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/32/libstdc++.so.6                 ld-linux.so.2 => /lib64/ld-linux.so.2             libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/32/libgcc_s.so.1         libicuuc.so.49 => /usr/lib64/libicuuc.so.49         libicudata.so.49 => /usr/lib64/libicudata.so.49         libz.so.1 => /lib64/libz.so.1         liblzma.so.5 => /usr/lib64/liblzma.so.5         libm.so.6 => /lib64/libm.so.6     libpthread.so.0 => /lib64/libpthread.so.0     libc.so.6 => /lib64/libc.so.6 
like image 118
Michał Górny Avatar answered Sep 20 '22 14:09

Michał Górny