From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6603 invoked by alias); 12 Apr 2007 23:03:45 -0000 Received: (qmail 6593 invoked by uid 22791); 12 Apr 2007 23:03:43 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 13 Apr 2007 00:03:36 +0100 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l3CN3YqF032335 for ; Thu, 12 Apr 2007 19:03:34 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l3CN3Y7q017290 for ; Thu, 12 Apr 2007 19:03:34 -0400 Received: from ironwood.lan (vpn-14-197.rdu.redhat.com [10.11.14.197]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l3CN3XRb006361 for ; Thu, 12 Apr 2007 19:03:34 -0400 Date: Thu, 12 Apr 2007 23:03:00 -0000 From: Kevin Buettner To: gdb-patches@sources.redhat.com Subject: Re: [rfc] Shared libraries in static programs Message-ID: <20070412160333.07d543a4@ironwood.lan> In-Reply-To: <20070412221025.GA2848@caradoc.them.org> References: <20070412221025.GA2848@caradoc.them.org> X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.10.4; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-04/txt/msg00182.txt.bz2 On Thu, 12 Apr 2007 18:10:25 -0400 Daniel Jacobowitz wrote: > Glibc has a complicated mechanism where a static executable may > include a chunk of libdl, for dlopen. If this gets used, then it > initializes _r_debug just like normal. > > There are three differences: > - There's no .dynamic, so we can't use DT_DEBUG. > - We shouldn't skip the first thing on the list, because the > executable is not dynamic and therefore is not on the list. > - _dl_debug_state might be in exec_bfd, so we should set a > breakpoint there if we can. > > This patch, lightly tested, lets me get at the shared library I was > trying to debug. Does it look OK? It looks reasonable to me. Feel free to commit it. Thanks, Kevin