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

patch for elf32-mips.c


symptom:

    for some mips-elf targets, the linker sometimes
    spuriously complains:

	relocation truncated to fit: R_MIPS_LITERAL no symbol

analysis:

    mips_elf_calculate_relocation () sometimes neglects to
    set gp and gp0 before using them.

fix:

1999-09-25  Felix Lee  <flee@cygnus.com>

	* elf32-mips.c (mips_elf_calculate_relocation): Typo
	  and R_MIPS_LITERAL bug.

Index: elf32-mips.c
===================================================================
RCS file: /cvs/binutils/binutils/bfd/elf32-mips.c,v
retrieving revision 1.51
diff -c -p -r1.51 elf32-mips.c
*** elf32-mips.c	1999/08/27 00:08:49	1.51
--- elf32-mips.c	1999/09/25 12:53:02
*************** mips_elf_calculate_relocation (abfd, 
*** 5895,5901 ****
        *namep = bfd_elf_string_from_elf_section (input_bfd,
  						symtab_hdr->sh_link,
  						sym->st_name);
!       if (*namep == '\0')
  	*namep = bfd_section_name (input_bfd, sec);
  
        target_is_16_bit_code_p = (sym->st_other == STO_MIPS16);
--- 5895,5901 ----
        *namep = bfd_elf_string_from_elf_section (input_bfd,
  						symtab_hdr->sh_link,
  						sym->st_name);
!       if (**namep == '\0')
  	*namep = bfd_section_name (input_bfd, sec);
  
        target_is_16_bit_code_p = (sym->st_other == STO_MIPS16);
*************** mips_elf_calculate_relocation (abfd, 
*** 6070,6075 ****
--- 6070,6077 ----
        
      case R_MIPS_HI16:
      case R_MIPS_LO16:
+     case R_MIPS_LITERAL:
+     case R_MIPS16_GPREL:
      case R_MIPS_GPREL16:
      case R_MIPS_GPREL32:
        gp0 = _bfd_get_gp_value (input_bfd);


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