This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Patch: Re: bug in ld -rpath ??
Date: Tue, 22 Aug 2000 07:45:56 -0700
From: "H . J . Lu" <hjl@lucon.org>
It now displays:
libused_by_a.so needed by a/liba.so
found libused_by_a.so at /home/hjl/bugs/gas/rpath/a/../u/libused_by_a.so
Great!
> I think it would be a good idea to mention how the DSO was found
> (i.e. -rpath, -rpath-link, DT_RPATH, LD_RUN_PATH, standard search
> directories) like the GNU ld.so does. That would be a big help in
> resolving problems with conflicting search dirs. I don't know if this
> is easy to implement though.
It is documented in ld.texinfo. I have added DT_RPATH/DT_RUNPATH.
Yeah I know, but it can be useful to know exactly what caused the
linker to choose the location. But this is something that would be
"nice to have" and I guess that if I want it I should implement it
myself :-).
Here is the patch. There are 2 things I'd like to mention:
1. DT_RPATH/DT_RUNPATH are only used to search for DSOs needed by the
DSO where DT_RPATH/DT_RUNPATH come from:
found = (rp->by == l->by
&& gld${EMULATION_NAME}_search_needed (rp->name,
l->name,
force));
It follows the ld.so closer than -rpath/-rpath-link.
That's good!
2. I think -rpath should be used for native linker only. My patch
doesn't address that. I can provide a separate patch after we finish
this one
I think I agree, although it is a bit fuzzy what exactly a "native
linker" is. A "native" Linux binutils actually does work fine as a
cross-binutils for other ELF/x86 targets. The only difference between
a "native" linker and a "cross" linker is the default search path (at
least before your path).
Mark