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]

PATCH: Fix seg-fault in MIPS linkers


Hi Guys,

  I am checking in the patch below to fix a seg-fault in the MIPS
  linkers.  Various examples in the linker testsuite were triggering
  this bug whereby _bfd_mips_elf_check_relocs() could be called when
  the symbol hashes were not available but the code was not ready to
  handle the situation.

Cheers
  Nick

bfd/ChangeLog
2008-08-17  Nick Clifton  <nickc@redhat.com>

	* elfxx-mips.c (_bfd_mips_elf_check_relocs): Handle the situation
	where the sym_hashes are not available.

Index: bfd/elfxx-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-mips.c,v
retrieving revision 1.247
diff -c -3 -p -r1.247 elfxx-mips.c
*** bfd/elfxx-mips.c	8 Aug 2008 19:24:48 -0000	1.247
--- bfd/elfxx-mips.c	17 Aug 2008 20:35:51 -0000
*************** _bfd_mips_elf_check_relocs (bfd *abfd, s
*** 7433,7440 ****
        else
  	{
  	  h = sym_hashes[r_symndx - extsymoff];
! 	  while (h->root.type == bfd_link_hash_indirect
! 		 || h->root.type == bfd_link_hash_warning)
  	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
  	}
  
--- 7433,7441 ----
        else
  	{
  	  h = sym_hashes[r_symndx - extsymoff];
! 	  while (h != NULL
! 		 && (h->root.type == bfd_link_hash_indirect
! 		     || h->root.type == bfd_link_hash_warning))
  	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
  	}
  


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