From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6779 invoked by alias); 8 Mar 2007 16:05:17 -0000 Received: (qmail 6769 invoked by uid 22791); 8 Mar 2007 16:05:16 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Thu, 08 Mar 2007 16:05:05 +0000 Received: from dsl093-172-095.pit1.dsl.speakeasy.net ([66.93.172.95] helo=caradoc.them.org) by nevyn.them.org with esmtp (Exim 4.63) (envelope-from ) id 1HPL6z-0001K3-SH; Thu, 08 Mar 2007 11:05:01 -0500 Received: from drow by caradoc.them.org with local (Exim 4.63) (envelope-from ) id 1HPL6z-0002AC-8X; Thu, 08 Mar 2007 11:05:01 -0500 Date: Thu, 08 Mar 2007 16:05:00 -0000 From: Daniel Jacobowitz To: Roland Puntaier Cc: gdb@sources.redhat.com Subject: Re: relocations when doing file command at gdb prompt Message-ID: <20070308160501.GA8042@caradoc.them.org> Mail-Followup-To: Roland Puntaier , gdb@sources.redhat.com References: <20070308152210.GA4971@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) 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: 2007-03/txt/msg00134.txt.bz2 On Thu, Mar 08, 2007 at 04:49:06PM +0100, Roland Puntaier wrote: > > So, are you loading an object file or a linked program? > An object file. Actually, ET_DYN is not quite either. It's more like a linked program for the purpose of my question. > > Does it have relocations included? > Yes > [Elf32_Stab] > n_strx: 0x14 > n_type: 0x64 > n_other: 0x0 > n_desc: 0x2 > n_value: 0x8048238 > [Elf32_Rel] > r_offset: 0x14 > r_info: 0x601 --> ELF32_R_SYM:0x6, ELF32_R_TYPE:0x1(R_386_32) So, it's relocated already, but the relocations are still present. No wonder GDB is doubling them. This code was originally added for shared libraries (ET_DYN). Those generated by the GNU binutils at the time had relocations in shared libraries that had _not_ been applied. I don't see how we can sensibly distinguish the two cases. What toolchain produced this file? -- Daniel Jacobowitz CodeSourcery