From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18920 invoked by alias); 23 Jan 2005 23:44:57 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 18614 invoked from network); 23 Jan 2005 23:44:40 -0000 Received: from unknown (HELO gizmo11bw.bigpond.com) (144.140.70.21) by sourceware.org with SMTP; 23 Jan 2005 23:44:40 -0000 Received: (qmail 19305 invoked from network); 23 Jan 2005 23:44:38 -0000 Received: from unknown (HELO bwmam12.bigpond.com) (144.135.24.103) by gizmo11bw.bigpond.com with SMTP; 23 Jan 2005 23:44:38 -0000 Received: from cpe-144-136-221-26.sa.bigpond.net.au ([144.136.221.26]) by bwmam12.bigpond.com(MAM REL_3_4_2a 189/50237937) with SMTP id 50237937; Mon, 24 Jan 2005 09:44:38 +1000 Received: by bubble.modra.org (Postfix, from userid 500) id 84E6A15EA9F; Mon, 24 Jan 2005 10:14:38 +1030 Date: Sun, 23 Jan 2005 23:44:00 -0000 From: Alan Modra To: Nathan Sidwell Cc: binutils@sources.redhat.com, ian@airs.com Subject: Re: [patch] gas dwarf2 debug emission Message-ID: <20050123234438.GC18895@bubble.modra.org> Mail-Followup-To: Nathan Sidwell , binutils@sources.redhat.com, ian@airs.com References: <41F29070.1030400@codesourcery.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41F29070.1030400@codesourcery.com> User-Agent: Mutt/1.4i X-SW-Source: 2005-01/txt/msg00370.txt.bz2 On Sat, Jan 22, 2005 at 05:42:08PM +0000, Nathan Sidwell wrote: > + emit_other_sections = !info_seg || subseg_empty_p (info_seg); The convention in binutils is to compare non-boolean values against NULL or 0, so emit_other_sections = info_seg == NULL || subseg_empty_p (info_seg); > + /* Return nonzero if SEC has at least one byte of data. */ > + > + int > + subseg_empty_p (segT sec) Comment doesn't match function return value. More seriously o You're using the function to test whether a section is non-empty, but the code only looks at the first sub-section. The function ought to run down frch_next, and be called seg_empty_p (or section_empty_p, gas nomenclature is a little confusing). o The function doesn't handle a number of frag types that might have fr_fix zero but still contribute to section size. Correcting this isn't easy, and unfortunately I think it will be possible to construct cases where it's impossible to guess the frag size at this stage of assembly. So I'll let this pass if you add a comment. -- Alan Modra IBM OzLabs - Linux Technology Centre