From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16307 invoked by alias); 16 Nov 2006 21:02:48 -0000 Received: (qmail 16298 invoked by uid 22791); 16 Nov 2006 21:02:48 -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 21:02:38 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1GkoNY-0006aL-9g; Thu, 16 Nov 2006 16:02:36 -0500 Date: Thu, 16 Nov 2006 21:02: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: <20061116210236.GA25020@nevyn.them.org> Mail-Followup-To: Pedro Alves , gdb-patches@sourceware.org References: <455CCFAD.6060407@portugalmail.pt> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <455CCFAD.6060407@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/msg00149.txt.bz2 On Thu, Nov 16, 2006 at 08:53:01PM +0000, Pedro Alves wrote: > Hi all, > > The TLS without debugging info support introduced a bug for coff based > targets. > While printing for example a global symbol's value I am getting a > segfault in parse.c:write_exp_msymbol, > at: > if (SYMBOL_BFD_SECTION (msymbol)->flags & SEC_THREAD_LOCAL) > > The problem is that minimal symbols may not have a bfd section set. > > The attached patch fixes it, but is it correct? > I see in coffread.c, that prim_record_minimal_symbol_and_info is always > called with a NULL > bfd section, whilst in elfread.c, is is not. Is this a limitation of the > coff format? Should coffread.c > be fixed instead? Honestly, I'm not quite sure. You've got the section index, so maybe in prim_record_minimal_symbol_and_info it could fill in a NULL bfd_section from the objfile sections table? -- Daniel Jacobowitz CodeSourcery