Re: Why does solib_open do what it does?

Kris Warkentin
2003-06-19T12:24:25Z

> > 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?
>
> No, I just recall that, several years ago when I worked on this code,
> it was not always true.

Okay gentlemen, all kidding aside, what do we do? At the bare minimum I
believe the test

/* If not found, next search the inferior's $PATH environment variable. */
if (found_file < 0 && solib_search_path != NULL)

should be just:

if (found_file < 0).

We can always make a decision about removing the PATH and LD_LIBRARY_PATH
checks later.

cheers,

Kris