From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23472 invoked by alias); 10 Mar 2006 19:50:08 -0000 Received: (qmail 23455 invoked by uid 22791); 10 Mar 2006 19:50:07 -0000 X-Spam-Check-By: sourceware.org Received: from w099.z064220152.sjc-ca.dsl.cnc.net (HELO duck.specifix.com) (64.220.152.99) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 10 Mar 2006 19:50:05 +0000 Received: from [127.0.0.1] (duck.corp.specifix.com [192.168.1.1]) by duck.specifix.com (Postfix) with ESMTP id B3092FC56; Fri, 10 Mar 2006 11:50:01 -0800 (PST) Subject: Re: linker debug info editing From: James E Wilson To: Alan Modra Cc: binutils@sourceware.org, gdb-patches@sourceware.org In-Reply-To: <20060310124921.GN6777@bubble.grove.modra.org> References: <20060310124921.GN6777@bubble.grove.modra.org> Content-Type: text/plain Message-Id: <1142020201.13901.29.camel@aretha.corp.specifix.com> Mime-Version: 1.0 Date: Fri, 10 Mar 2006 20:06:00 -0000 Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-03/txt/msg00164.txt.bz2 On Fri, 2006-03-10 at 04:49, Alan Modra wrote: > This is a first pass at debug info editing to remove bogus entries for > link-once functions. There is an equivalent gcc solution we could consider. Create a separate compilation unit die for each linkonce function. We could use section groups to tie the debug info to the linkonce function, so that the debug info disappears along with the function. We already have a similar scheme in use for header files, that mirrors the BINCL/EINCL stabs support. This was one of the new features that went into the DWARF3 standard. Unfortunately, this code is not the default yet. You have to specify -feliminate-dwarf2-dups to get it. I think there was some gdb work that needed to be done to complete the project, and us gcc developers aren't very good at volunteering to do gdb work. Using a similar approach for linkonce functions would probably also require some gdb work. For one thing, we would have a lot more compilation unit dies than we had before (worst case one per function instead of one per file), and gdb might not be able to handle that. Checking the DWARF3 standard, it specifically mentions elimination function duplications in Appendix E, in section E.4.2. Appendix E describes how to use multiple compilation units and section groups to eliminate duplication debug info. If we do need link time editing of dwarf2 debug info, there is a lot of useful stuff that could be done here, such as eliminating duplicate debug_abbrev entries. This is probably more complicated than what you are attempting here though, but it could perhaps be added later on top of your work. You mentioned a bunch of assumptions in the code. Those assumptions should be tested against some compilers other than gcc. Testing the Intel compiler might not be too hard for instance, especially if you can get HJ to do it for you. -- Jim Wilson, GNU Tools Support, http://www.specifix.com