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]

mips_elf_calculate_relocation() returns false.


Hi Eric,

  Don Lindsay pointed out the the function
  mips_elf_calculate_relocation() returns false in several places
  where error are detected, but the return type of the function is
  bfd_reloc_status_type, where a 0 value is bfd_reloc_ok.  He has
  provided a patch to fix this, (attached below) which I think should
  be applied.  What do you think ?

Cheers
        Nick


2002-01-30  Don Lindsay <lindsay@cisco.com>

	* elf32-mips.c (mips_elf_calculate_relocation): Replace
        'false' return values with bfd_reloc_ error codes.

Index: bfd/elf32-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-mips.c,v
retrieving revision 1.141
diff -c -3 -p -w -r1.141 elf32-mips.c
*** elf32-mips.c	2002/01/30 02:19:21	1.141
--- elf32-mips.c	2002/01/30 17:03:16
*************** mips_elf_calculate_relocation (abfd,
*** 6788,6794 ****
  	{
  	  g = mips_elf_local_got_index (abfd, info, symbol + addend);
  	  if (g == (bfd_vma) -1)
! 	    return false;
  	}
  
        /* Convert GOT indices to actual offsets.  */
--- 6788,6794 ----
  	{
  	  g = mips_elf_local_got_index (abfd, info, symbol + addend);
  	  if (g == (bfd_vma) -1)
! 	    return bfd_reloc_outofrange;
  	}
  
        /* Convert GOT indices to actual offsets.  */
*************** mips_elf_calculate_relocation (abfd,
*** 6848,6854 ****
  						   symbol,
  						   &value,
  						   input_section))
! 	    return false;
  	}
        else
  	{
--- 6848,6854 ----
  						   symbol,
  						   &value,
  						   input_section))
! 	    return bfd_reloc_undefined;
  	}
        else
  	{
*************** mips_elf_calculate_relocation (abfd,
*** 6969,6975 ****
  						  local_sections, false);
  	  value = mips_elf_got16_entry (abfd, info, symbol + addend, forced);
  	  if (value == (bfd_vma) -1)
! 	    return false;
  	  value
  	    = mips_elf_got_offset_from_index (elf_hash_table (info)->dynobj,
  					      abfd,
--- 6969,6975 ----
  						  local_sections, false);
  	  value = mips_elf_got16_entry (abfd, info, symbol + addend, forced);
  	  if (value == (bfd_vma) -1)
! 	    return bfd_reloc_outofrange;
  	  value
  	    = mips_elf_got_offset_from_index (elf_hash_table (info)->dynobj,
  					      abfd,
*************** mips_elf_calculate_relocation (abfd,
*** 7013,7019 ****
      case R_MIPS_GOT_PAGE:
        value = mips_elf_got_page (abfd, info, symbol + addend, NULL);
        if (value == (bfd_vma) -1)
! 	return false;
        value = mips_elf_got_offset_from_index (elf_hash_table (info)->dynobj,
  					      abfd,
  					      value);
--- 7013,7019 ----
      case R_MIPS_GOT_PAGE:
        value = mips_elf_got_page (abfd, info, symbol + addend, NULL);
        if (value == (bfd_vma) -1)
! 	return bfd_reloc_outofrange;
        value = mips_elf_got_offset_from_index (elf_hash_table (info)->dynobj,
  					      abfd,
  					      value);


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