From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7944 invoked by alias); 22 Apr 2012 19:40:28 -0000 Received: (qmail 7934 invoked by uid 22791); 22 Apr 2012 19:40:27 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from shell4.bayarea.net (HELO shell4.bayarea.net) (209.128.82.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 22 Apr 2012 19:40:14 +0000 Received: (qmail 1832 invoked from network); 22 Apr 2012 12:40:14 -0700 Received: from c-76-102-3-160.hsd1.ca.comcast.net (HELO redwood.eagercon.com) (76.102.3.160) by shell4.bayarea.net with SMTP; 22 Apr 2012 12:40:14 -0700 Message-ID: <4F945E9D.8060409@eagerm.com> Date: Sun, 22 Apr 2012 19:40:00 -0000 From: Michael Eager User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: Andreas Schwab CC: gdb@sourceware.org Subject: Re: GDB shared library tests with remote target References: <4F944677.2030504@eagerm.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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/msg00175.txt.bz2 On 04/22/2012 12:30 PM, Andreas Schwab wrote: > 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. 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