From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13877 invoked by alias); 22 Apr 2012 19:30:50 -0000 Received: (qmail 13868 invoked by uid 22791); 22 Apr 2012 19:30:49 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mail-out.m-online.net (HELO mail-out.m-online.net) (212.18.0.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 22 Apr 2012 19:30:36 +0000 Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3VbLVx62jJz3hhXh; Sun, 22 Apr 2012 21:30:33 +0200 (CEST) Received: from igel.home (ppp-88-217-122-82.dynamic.mnet-online.de [88.217.122.82]) by mail.mnet-online.de (Postfix) with ESMTPA id 3VbLVy0cDjz4KK2Y; Sun, 22 Apr 2012 21:30:34 +0200 (CEST) Received: by igel.home (Postfix, from userid 501) id 47911CA2A9; Sun, 22 Apr 2012 21:30:32 +0200 (CEST) From: Andreas Schwab To: Michael Eager Cc: gdb@sourceware.org Subject: Re: GDB shared library tests with remote target References: <4F944677.2030504@eagerm.com> X-Yow: I want to read my new poem about pork brains and outer space... Date: Sun, 22 Apr 2012 19:30:00 -0000 In-Reply-To: <4F944677.2030504@eagerm.com> (Michael Eager's message of "Sun, 22 Apr 2012 10:57:11 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.95 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2012-04/txt/msg00174.txt.bz2 Michael Eager 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."