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


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


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