This is the mail archive of the binutils@sourceware.org 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]

COMMITTED: Stop infinite loop dumping mips binary


Hi Guys,

  I ran into a problem with objdump from the mips64-linux toolchain
  going into an infinite loop during the mips-elf linker tests.  I am
  applying the patch below to catch the case where the computed next
  offset is in fact the same as (or less than) the current offset.

Cheers
  Nick

binutils/ChangeLog
2009-03-05  Nick Clifton  <nickc@redhat.com>

	* objdump.c (disassemble_section): If the computed next offset is
	not beyond the current offset then just continue to the end.

Index: binutils/objdump.c
===================================================================
RCS file: /cvs/src/src/binutils/objdump.c,v
retrieving revision 1.156
diff -c -3 -p -r1.156 objdump.c
*** binutils/objdump.c	3 Mar 2009 01:27:15 -0000	1.156
--- binutils/objdump.c	5 Mar 2009 16:00:05 -0000
*************** disassemble_section (bfd *abfd, asection
*** 1961,1967 ****
        else
  	nextstop_offset = bfd_asymbol_value (nextsym) - section->vma;
  
!       if (nextstop_offset > stop_offset)
  	nextstop_offset = stop_offset;
  
        /* If a symbol is explicitly marked as being an object
--- 1961,1968 ----
        else
  	nextstop_offset = bfd_asymbol_value (nextsym) - section->vma;
  
!       if (nextstop_offset > stop_offset
! 	  || nextstop_offset <= addr_offset)
  	nextstop_offset = stop_offset;
  
        /* If a symbol is explicitly marked as being an object


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