This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [patch] gas dwarf2 debug emission
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Nathan Sidwell <nathan at codesourcery dot com>
- Cc: binutils at sources dot redhat dot com, ian at airs dot com
- Date: Mon, 24 Jan 2005 10:14:38 +1030
- Subject: Re: [patch] gas dwarf2 debug emission
- References: <41F29070.1030400@codesourcery.com>
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