This is the mail archive of the gdb@sourceware.org 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: GDB shared library tests with remote target


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."


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