This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Why does solib_open do what it does?
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. I had to
reimplement ELF search order a few months ago. It's considerably more
complex then what we do here - DT_RPATH for example.
> >In fact, for remote debugging, leaving these checks in is rather
> >dangerous. If, for some reason, the shared lib is not found via
> >either solib-absolute-prefix or solib-search-path, we don't want
> >to search paths on the host file system which refer to the hosts
> >libraries. If the file is found via one of these paths, it is
> >almost certainly wrong, and I've seen cases where this can cause
> >wildly unpredictable behavior. (E.g, segfaults on the target, or
> >breakpoints being hit at strange places.)
>
> Agreed. Indeed, I think LD_LIBRARY_PATH is required for native,
> and always wrong for cross. Is there any way we can use that
> distinction? Maybe with a configure variable?
No. Please take a look at PR gdb/633 and the discussion there.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer