This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
GDB shared library tests with remote target
- From: Michael Eager <eager at eagerm dot com>
- To: gdb at sourceware dot org
- Date: Sun, 22 Apr 2012 10:57:11 -0700
- Subject: GDB shared library tests with remote target
The gdb test suite contains a claim in gdb.exp:skip_shlib_tests
that the shared library tests should work for a variety of remote
targets, including Linux.
When gdb compiles the executable, it uses absolute paths to the
shared libraries. The linker is passed "-rpath $ORIGIN" which
effectively adds the directory containing the executable to the
library search path at run time.
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.
It doesn't look to me like this could ever work. The only way
(AFAIK) to have the linker put in a relative path to the shared
library is to run the link step in the build directory and use
a relative path, not an absolute path.
Q. Is there any option to tell the linker not to put a full
path in DT_NEEDED?
Q. Did this ever work? If yes, how and how do I make it work now?
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077