From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5813 invoked by alias); 16 Nov 2006 23:59:19 -0000 Received: (qmail 5804 invoked by uid 22791); 16 Nov 2006 23:59:19 -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, 16 Nov 2006 23:59:13 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1Gkr8P-00005Q-My; Thu, 16 Nov 2006 18:59:09 -0500 Date: Thu, 16 Nov 2006 23:59:00 -0000 From: Daniel Jacobowitz To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: Crash in write_exp_msymbol for coff targets. Message-ID: <20061116235909.GA32450@nevyn.them.org> Mail-Followup-To: Pedro Alves , gdb-patches@sourceware.org References: <455CCFAD.6060407@portugalmail.pt> <20061116210236.GA25020@nevyn.them.org> <455CF6BA.2030306@portugalmail.pt> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <455CF6BA.2030306@portugalmail.pt> User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes 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-11/txt/msg00156.txt.bz2 On Thu, Nov 16, 2006 at 11:39:38PM +0000, Pedro Alves wrote: > Like in the attached patch1.diff? > > Or, it isn't safe to index the objfile->sections by section index, > and we have to look them up linearly? That is what patch2.diff does. > In that version, I've repeated the search on coffread.c, caching the last > section looked up. Only slightly tested, but I got around around 50% cache > hit on a few exes. (Premature optimization?) I'm somewhat worried about the numbering :-( It looks like "int section" is only useful for ANOFFSET / struct section_offsets. And that suggests there's no useful way to get from those numbers to the bfd_section or vice versa. What an awful mess. I suppose the only way to fix this will be to overhaul the associated code and reduce the number of numberings in use. But in the mean time, we should use your original patch that checked for non-NULL. Sorry for the runaround. Shall I commit it for you? -- Daniel Jacobowitz CodeSourcery