This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB 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: [RFC]: Solib search (Was: Re: Cross solib support; continued)


Daniel Jacobowitz wrote:
> 
> On Tue, Nov 27, 2001 at 08:15:44PM +0100, Orjan Friberg wrote:
> > Daniel Jacobowitz wrote:
> > >
> > > Suppose that I dlopen ("/lib/mmx/libc.so.6", ...).  That's the case I
> > > am describing.  The only way to handle this case properly (assuming
> > > there is also a /lib/libc.so.6) is to go through one of the absolute
> > > path cases.  There is no other option.
> >
> > But won't dlopen ("/lib/mmx/libc.so.6", ...) be handled by:
> >
> >   if (! IS_ABSOLUTE_PATH (in_pathname) || solib_absolute_prefix == NULL)
> >     temp_pathname = in_pathname;
> >   else
> >     {
> >       [Catting of prefix and pathname]
> >     }
> >
> >   /* Now see if we can open it.  */
> >   found_file = open (temp_pathname, O_RDONLY, 0);
> >
> > That counts as an absolute path case, right?
> >
> > I can't see why we'd rely on the first openp to handle dlopen ("/lib/mmx/libc.so.6",
> > ...) since it's an absolute path and should be handled by the code above.  That's why
> > I suggest we know we should look in solib_search_path (and thus should get rid of the
> > leading '/' which makes it an absolute path).
> 
> Oh!  I was confused; sorry.

No problem; thanks for taking the time to review my patch.

> I think your patch is OK.  If we fail to find it in the absolute path,
> search for its "absolute" (without leading directory separator[s])
> path in each directory in the solib-search-path.  Then try searching
> for its basename as a last resort.  Right?

Right.  (And if basename search fails, we search $PATH and $LD_LIBRARY_PATH like
before.)  I will post an updated patch shortly.

-- 
Orjan Friberg
Axis Communications AB


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