[csw-maintainers] Determining shared object dependencies

Philip Brown phil at bolthole.com
Wed Dec 23 18:47:39 CET 2009


On Wed, Dec 23, 2009 at 9:10 AM, Maciej (Matchek) Blizinski
<maciej at opencsw.org> wrote:
> Let's suppose there's a shared object which depends on libstdc++.so.6.
>  I'd like to determine its dependencies.  Unfortunately,
> libstdc++.so.6 exists in more than one place in the filesystem:
>
> maciej at build8s [build8s]:~ > ls -l /opt/csw/{,gcc4/}lib/libstdc++.so.6
> lrwxrwxrwx   1 root     other         19 May 11  2009
> /opt/csw/gcc4/lib/libstdc++.so.6 -> libstdc++.so.6.0.10
> lrwxrwxrwx   1 root     other         20 Aug  7 11:50
> /opt/csw/lib/libstdc++.so.6 -> ./libstdc++.so.6.0.3
>
> How am I supposed to tell which one is the right one?  (Without
> trussing the running program, of course.)  The best idea I have is
> looking at the RUNPATH property of the library and assuming that the
> first one is the right one.  For example, if the RUNPATH was
> ['/opt/csw/gcc4/lib', '/opt/csw/lib/$ISALIST', '/opt/csw/lib',
> '/opt/csw/lib', '/opt/csw/lib/svn'], I would assume that
> /opt/csw/gcc4/lib/libstdc++.so.6 is the right one, because
> '/opt/csw/gcc4/lib' appears first on the RUNPATH list.
>
> Do you this this is a reliable method?


It is in theory what will actually get loaded at runtime. so yes :-)



More information about the maintainers mailing list