This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: GDB shared library tests with remote target
- From: Andreas Schwab <schwab at linux-m68k dot org>
- To: Michael Eager <eager at eagerm dot com>
- Cc: gdb at sourceware dot org
- Date: Sun, 22 Apr 2012 21:30:32 +0200
- Subject: Re: GDB shared library tests with remote target
- References: <4F944677.2030504@eagerm.com>
Michael Eager <eager@eagerm.com> writes:
> When gdb compiles the executable, it uses absolute paths to the
> shared libraries. The linker is passed "-rpath $ORIGIN" which
It is passed "-rpath \$ORIGIN" which puts $ORIGIN verbatim in the RPATH.
> effectively adds the directory containing the executable to the
> library search path at run time.
$ORIGIN is expanded *at run time*, pointing to the directory the
executable is located when executed.
> When run on a remote system, the test fails to load the shared
> library because the loader has an absolute path to the shared
> library and does not search for it.
If the shared library is located in the same directory as the executable
then it will be found due to $ORIGIN.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."