From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14928 invoked by alias); 22 Apr 2012 17:57:25 -0000 Received: (qmail 14920 invoked by uid 22791); 22 Apr 2012 17:57:24 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00 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 17:57:12 +0000 Received: (qmail 5176 invoked from network); 22 Apr 2012 10:57:11 -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 10:57:11 -0700 Message-ID: <4F944677.2030504@eagerm.com> Date: Sun, 22 Apr 2012 17:57: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: gdb@sourceware.org Subject: GDB shared library tests with remote target 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/msg00173.txt.bz2 The gdb test suite contains a claim in gdb.exp:skip_shlib_tests that the shared library tests should work for a variety of remote targets, including Linux. When gdb compiles the executable, it uses absolute paths to the shared libraries. The linker is passed "-rpath $ORIGIN" which effectively adds the directory containing the executable to the library search path at run time. 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. It doesn't look to me like this could ever work. The only way (AFAIK) to have the linker put in a relative path to the shared library is to run the link step in the build directory and use a relative path, not an absolute path. Q. Is there any option to tell the linker not to put a full path in DT_NEEDED? Q. Did this ever work? If yes, how and how do I make it work now? -- Michael Eager eager@eagercon.com 1960 Park Blvd., Palo Alto, CA 94306 650-325-8077