From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3366 invoked by alias); 3 Aug 2007 00:21:12 -0000 Received: (qmail 3347 invoked by uid 22791); 3 Aug 2007 00:21:12 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 03 Aug 2007 00:21:06 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 39A5D98122; Fri, 3 Aug 2007 00:21:06 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 142C498100; Fri, 3 Aug 2007 00:21:05 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.67) (envelope-from ) id 1IGkud-0005Ag-HN; Thu, 02 Aug 2007 20:21:03 -0400 Date: Fri, 03 Aug 2007 00:21:00 -0000 From: Daniel Jacobowitz To: Jan Kratochvil , Roland McGrath , binutils@sources.redhat.com Subject: Re: [patch] bfd: Core files with p_filesz < p_memsz (build-id) Message-ID: <20070803002103.GA19863@caradoc.them.org> Mail-Followup-To: Jan Kratochvil , Roland McGrath , binutils@sources.redhat.com References: <20070728191354.GA14892@host0.dyn.jankratochvil.net> <20070728201604.AEBDB4D058D@magilla.localdomain> <20070729165314.GA8906@host0.dyn.jankratochvil.net> <20070801130547.GN23966@bubble.grove.modra.org> <20070802200249.GA7696@caradoc.them.org> <20070803001259.GA11213@bubble.grove.modra.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070803001259.GA11213@bubble.grove.modra.org> User-Agent: Mutt/1.5.15 (2007-04-09) X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2007-08/txt/msg00045.txt.bz2 On Fri, Aug 03, 2007 at 09:43:00AM +0930, Alan Modra wrote: > Oh, I see. I was just looking at the split case. I'd say the > non-split behaviour is a bug. A program header with p_filesz zero and > p_memsz non-zero really ought to create a bfd section with size equal > to p_memsz, without SEC_HAS_CONTENTS and SEC_LOAD. > > So I think we should apply the following, and possibly on top of this > do something special for core files. Yes, I agree. But keep in mind that this patch on its own is going to lay waste to GDB's core debugging :-) It will now disassemble all functions as zeroes. What we really want in GDB is now a bit complicated: - Prefer data from core file if within p_filesz. - Prefer data from executable if between p_filesz and p_memsz. - Show zeroes (rather than read errors) for data between p_filesz and p_memsz if not present in the executable. Messy... -- Daniel Jacobowitz CodeSourcery