From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25145 invoked by alias); 7 Aug 2005 20:01:48 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 25131 invoked by uid 22791); 7 Aug 2005 20:01:45 -0000 Received: from smtp104.sbc.mail.mud.yahoo.com (HELO smtp104.sbc.mail.mud.yahoo.com) (68.142.198.203) by sourceware.org (qpsmtpd/0.30-dev) with SMTP; Sun, 07 Aug 2005 20:01:45 +0000 Received: (qmail 31942 invoked from network); 7 Aug 2005 20:01:43 -0000 Received: from unknown (HELO lucon.org) (hjjean@sbcglobal.net@67.122.70.18 with login) by smtp104.sbc.mail.mud.yahoo.com with SMTP; 7 Aug 2005 20:01:43 -0000 Received: by lucon.org (Postfix, from userid 1000) id 113F563F44; Sun, 7 Aug 2005 13:01:42 -0700 (PDT) Date: Sun, 07 Aug 2005 20:01:00 -0000 From: "H. J. Lu" To: GDB Subject: Re: Does gdb understand copy relocation? Message-ID: <20050807200141.GA23363@lucon.org> References: <20050807151216.GA18252@lucon.org> <20050807190859.GA17992@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050807190859.GA17992@nevyn.them.org> User-Agent: Mutt/1.4.1i X-SW-Source: 2005-08/txt/msg00033.txt.bz2 On Sun, Aug 07, 2005 at 03:08:59PM -0400, Daniel Jacobowitz wrote: > On Sun, Aug 07, 2005 at 08:12:16AM -0700, H. J. Lu wrote: > > On targets with copy relocation, when executable references a data > > symbol defined in DSO, a copy relocation will be used to copy the > > definition from DSO to executable and the copy in executable will be > > used by the process. But gdb I am using insists using the one in DSO. > > Is there a way to teach gdb about copy relocation? > > GDB does not know anything about symbol resolution at all. It also > does not use the relocations for much of anything, just the symbol > tables. > > I would have expected it to prefer the copy in the executable. I'm a > bit surprised if it didn't. There is no DW_AT_location for copy relocated symbol. But the symbol tables have 84: 080ebbd0 4 OBJECT GLOBAL DEFAULT 24 optarg@GLIBC_2.0 (2) 2297: 080ebbd0 4 OBJECT GLOBAL DEFAULT 24 optarg@@GLIBC_2.0 If I strip the binary, gdb seems to know the location of optarg. I think gdb should consult symbol tables in executable if the debug info doesn't have DW_AT_location. H.J.