This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libraries search path adjusting proposal


On Fri, May 07, 2004 at 07:00:49PM +0400, GalaxyMaster wrote:
> Hello, everyone!
> 
> I think that current logic of searching for libraries in ld is not
> perfect :( Imagine for example the next situation: we have a static
> library libdummy.a in the /usr/lib and the shared library libdummy.so in
> the /lib -- if we will try to link executable with -ldummy, we will
> constantly get static link with libdummy.a.

Your change only affect "system" libraries. Your system vendor should
make sure that the .so file and the .a file are in the right places.
And on systems with multilibs, your modification may not work.

> 
> We, Openwall Team, implemented and tested included patch for 3 months
> and have found no problems with it. The proposed logic follows:
> 
> 1. if this is not an archive, try to open it in current directory first
> 2. scan search path for dynamic objects (*)
> 3. scan search path for archive objects
> 
> (*) - if the pathname in the search path comes from command line (i.e.
>       was specified via -L command line switch, then if opening of the
>       dynamic object fails, try to open archive object.  This is done
>       because else we will break ability to build executables with
>       included libraries whose versions differ from the system ones.
> 


H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]