From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5362 invoked by alias); 5 Jan 2009 17:13:24 -0000 Received: (qmail 5325 invoked by uid 22791); 5 Jan 2009 17:13:23 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 05 Jan 2009 17:13:19 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 6B29F10D55; Mon, 5 Jan 2009 17:13:16 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id 568B3105B6; Mon, 5 Jan 2009 17:13:16 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1LJt0t-0008Gt-AG; Mon, 05 Jan 2009 12:13:15 -0500 Date: Mon, 05 Jan 2009 17:13:00 -0000 From: Daniel Jacobowitz To: Mathieu Lacage Cc: gdb@sourceware.org Subject: Re: how to make gdb happy with my linkmap Message-ID: <20090105171315.GA31779@caradoc.them.org> Mail-Followup-To: Mathieu Lacage , gdb@sourceware.org References: <74fef6df0812181341x8ecdd31me028bd4d658384b1@mail.gmail.com> <20081218214854.GA7706@caradoc.them.org> <74fef6df0812181402n1debced5xbe3f402a3a34ecf2@mail.gmail.com> <20081218221005.GA9012@caradoc.them.org> <74fef6df0812260239o1f21e833t6464c9d41bedcdd1@mail.gmail.com> <20081226125329.GA12783@caradoc.them.org> <74fef6df0901050658g6c279a3ah321c7c6e30630475@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <74fef6df0901050658g6c279a3ah321c7c6e30630475@mail.gmail.com> User-Agent: Mutt/1.5.17 (2008-05-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: 2009-01/txt/msg00013.txt.bz2 On Mon, Jan 05, 2009 at 03:58:39PM +0100, Mathieu Lacage wrote: > What I find weird is: > 1) mathieu@mathieu-boulot:~/code/elf-loader$ readelf -s ./ldso |grep stage1 > 225: 00000932 135 FUNC GLOBAL HIDDEN 6 stage1 > mathieu@mathieu-boulot:~/code/elf-loader$ readelf -l ./ldso > > Elf file type is DYN (Shared object file) > Entry point 0x932 > There are 6 program headers, starting at offset 52 > [...] > > i.e., stage1 is located at offset 0x932, and not 0x944 so, I can't > figure out where the 0x944 displayed by gdb is coming from. That's prologue skipping; it's just walking past the frame setup. This helps GDB to display function arguments correctly. > I also > find it surprising that gdb is actually trying to set a breakpoint at > address 0x944: this is a pie binary so, gdb should know that the > address will be known only once the program is run.... This is the same problem as PIE support. Ubuntu and Fedora carry some patches to improve PIE support; I think that Jan K. was talking about merging those at some point. I haven't looked at them in years. -- Daniel Jacobowitz CodeSourcery