Why does solib_open do what it does?

Michael Snyder msnyder@redhat.com
Wed Jun 18 00:14:00 GMT 2003


Kevin Buettner wrote:
> On Jun 17,  4:15pm, Kris Warkentin wrote:
> 
> 
>>>>That's what I was thinking too.  A customer reported that when they
>>>
>>don't
>>
>>>>set solib-search-path, all of a sudden gdb isn't finding solibs that
>>>
>>used to
>>
>>>>be found in LD_LIBRARY_PATH.
>>>
>>>It sounds to me like the solibs in question were actually being found via
>>>solib-search-path, not LD_LIBRARY_PATH.
>>>
>>>I think the problem with using LD_LIBRARY_PATH is that the paths
>>>won't be correct without some sort of adjustment.  I.e, the paths
>>>provided by LD_LIBRARY_PATH are target filesystem paths, not host
>>>paths.
>>
>>Well, I've always considered searching LD_LIBRARY_PATH at all to be wrong
>>since the only util that should be concerned with that is the runtime
>>loader.  Ideally, ld should be filling in the path where it found the lib
>>which can then be used with solib-absolute-prefix or some such.
> 
> 
> Right.
> 
> I think Michael added the searches on $PATH and $LD_LIBRARY_PATH for
> native ports, but it's not clear to me that these searches are actually
> needed.
> 
> Michael, any comments?

I don't remember.  ;-(
I'll just remark that ld puts full paths in for some libs, and not for others.
That's why there are two variables, SOLIB-SEARCH-PATH and 
SOLIB-ABSOLUTE-PREFIX.  One is the prefix that goes before everything
(even rooted filespecs), and the other is the additional prefix that
goes before an un-rooted filespec.





More information about the Gdb mailing list