This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Strange dependency on an unlinked shared library
- From: Ian Lance Taylor <iant at google dot com>
- To: Arun Kumar <arun dot einstein at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Tue, 22 Mar 2011 07:52:57 -0700
- Subject: Re: Strange dependency on an unlinked shared library
- References: <AANLkTikbh4YHM07BC-cQGqVnydzWSTNnRstPwjsk4UDU@mail.gmail.com> <AANLkTimma79JmLyb4EiHMbo9LgWZOYx1+ML403Nxi=zq@mail.gmail.com>
Arun Kumar <arun.einstein@gmail.com> writes:
> Â I'm linking an application against some shared libraries, which are
> compiled locally:
>
> ÂÂÂÂÂÂÂ gcc -Wl,--rpath=$ORIGIN/lib -L../../ffmpeg/lib -lavformat
> -lavutil my_prgram.o -o my_program
>
> Â When I do an
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ readelf -a my_program
>
> ÂÂ I see that the libraries libavformat.so.52, libavutil.so.49 etc..
> (basically the libraries in the path `../../ffmpeg/lib') are `NEEDED'
> and not anything else, but strangely enough
> when I try to execute -- it has a dependency on another
> libavformat.so.51 (probably an older version which might have been
> installed on the system in the past, but not on `NEEDED'
> list).
>
> Also on executing:
>
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ ldd
>
> ÂÂ It shows the dependency on the older version of the library is `not
> found'. I'm baffled, is there a possibility of executable asking for a
> library it was not linked against?
Sure, if one of the shared libraries on the NEEDED list itself has a
NEEDED reference.
Ian