GDB shared library tests with remote target
Michael Eager
eager@eagerm.com
Sun Apr 22 19:40:00 GMT 2012
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
More information about the Gdb
mailing list