Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Michael Eager <eager@eagerm.com>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: gdb@sourceware.org
Subject: Re: GDB shared library tests with remote target
Date: Sun, 22 Apr 2012 19:40:00 -0000	[thread overview]
Message-ID: <4F945E9D.8060409@eagerm.com> (raw)
In-Reply-To: <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


  reply	other threads:[~2012-04-22 19:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-22 17:57 Michael Eager
2012-04-22 19:30 ` Andreas Schwab
2012-04-22 19:40   ` Michael Eager [this message]
2012-04-22 21:07     ` Andreas Schwab
2012-04-23 17:40 ` Daniel Jacobowitz
2012-04-23 17:58   ` Michael Eager

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F945E9D.8060409@eagerm.com \
    --to=eager@eagerm.com \
    --cc=gdb@sourceware.org \
    --cc=schwab@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox