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: Michael Eager <eager at eagerm dot com>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: gdb at sourceware dot org
- Date: Sun, 22 Apr 2012 12:40:13 -0700
- Subject: Re: GDB shared library tests with remote target
- References: <4F944677.2030504@eagerm.com> <m2k417y36v.fsf@igel.home>
On 04/22/2012 12:30 PM, Andreas Schwab wrote:
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.
That's what I said.
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.
That's exactly what I said, verbatim.
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.
No, the DT_NEEDED path is used, since it has an absolute path.
If DT_NEEDED does not contain an absolute path, then the search
(including $ORIGIN) works.
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077