[patch] gas dwarf2 debug emission

Alan Modra amodra@bigpond.net.au
Sun Jan 23 23:44:00 GMT 2005


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



More information about the Binutils mailing list