PATCH: ld/2338: objdump -d -l doesn't work correctly

Alan Modra amodra@bigpond.net.au
Fri Mar 3 08:14:00 GMT 2006


On Thu, Mar 02, 2006 at 09:16:35PM -0800, H. J. Lu wrote:
> On Fri, Mar 03, 2006 at 01:12:09PM +1030, Alan Modra wrote:
> > On Tue, Feb 28, 2006 at 11:41:38AM -0800, H. J. Lu wrote:
> > > @@ -803,6 +815,15 @@ add_line_info (struct line_info_table *t
> > >        {
> > >  	/* Abnormal but easy: lcl_head is 1) in the *middle* of the line
> > >  	   list and 2) the head of 'info'.  */
> > > +	if (address == table->lcl_head->prev_line->address
> > > +	    && end_sequence != 0
> > > +	    && table->lcl_head->end_sequence != 0
> > > +	    && table->lcl_head->prev_line->end_sequence == 0)
> > > +	  {
> > > +	    /* If the new adress is the same, we need to make sure that
> > > +	       the order of end_sequence is correct.  */
> > > +	    table->lcl_head = table->lcl_head->prev_line;
> > > +	  }
> > >  	info->prev_line = table->lcl_head->prev_line;
> > >  	table->lcl_head->prev_line = info;
> > >  	break;
> > 
> > Convince me that this is correct.  ie. that you have actually done some
> > analysis and that this is the only place in add_line_info that needs to
> > do something special with end_sequence.
> 
> We can only 2 lines pointing to the same address: one is end_sequence
> and the other isn't. That is the only place where it can happen.

"That is the only place where it can happen" isn't good enough.  You are
just making an assertion.  Prove it.

Yes, I can probably analyse add_line_info myself, and decide whether
your patch is correct.  This requires some work on my part, and, it's
duplicating effort you have already made if you have done the analysis.
Of course, if you haven't properly analysed the function yourself, then
it's likely that your patch is wrong or incomplete.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list