This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] gas dwarf2 debug emission


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]