Re: Why does solib_open do what it does?

Daniel Jacobowitz
2003-06-18T20:27:40Z

On Wed, Jun 18, 2003 at 01:11:38PM -0700, Michael Snyder wrote:
> Daniel Jacobowitz wrote:
> >On Wed, Jun 18, 2003 at 11:41:02AM -0700, Michael Snyder wrote:
> >
> >>You don't think that gdb should honor LD_LIBRARY_PATH in native
> >>debugging, if it is set? Won't the linker-loader honor it?
> >>
> >>I'd be ready to agree that, if solib-search-path is set,
> >>it should override LD_LIBRARY_PATH. But if it isn't set...
> >
> >
> >As far as I'm concerned, the linker should always set the absolute
> >pathname, and we shouldn't be doing any of this junk.
>
> Well, but that is not in fact the case. For sure not on linux,
> and I don't think it is on solaris either.

In Linux it's the case for all searched-for objects, as far as I know -
anything found via search paths, LD_LIBRARY_PATH, DT_RUNPATH, DT_RPATH,
etc. will either be an absolute path or else contain slashes and be
relative to the current directory. If it's not true for dlopen'd
objects, well, there's no way to know where the app had chdir'd to when
it loaded them.

Do you know offhand when it's not true for GNU/Linux?

--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer