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]

PATCH: Correct handling of R_ARM_TARGET2 in elf32_arm_relocate_section


We got spurious warnings about uses of the R_ARM_TARGET2 relocation
because we forgot to translate it into the real underlying relocation
in elf32_arm_relocate_section.

OK?

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com

2004-11-15  Mark Mitchell  <mark@codesourcery.com>

	* elf32-arm.c (elf32_arm_relocate_section): Use
	arm_real_reloc_type.

Index: elf32-arm.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-arm.c,v
retrieving revision 1.7
diff -c -5 -p -r1.7 elf32-arm.c
*** elf32-arm.c	13 Nov 2004 13:38:15 -0000	1.7
--- elf32-arm.c	16 Nov 2004 02:46:27 -0000
*************** elf32_arm_relocate_section (bfd *       
*** 3062,3077 ****
--- 3062,3079 ----
    Elf_Internal_Shdr *symtab_hdr;
    struct elf_link_hash_entry **sym_hashes;
    Elf_Internal_Rela *rel;
    Elf_Internal_Rela *relend;
    const char *name;
+   struct elf32_arm_link_hash_table * globals;
  
  #if !USE_REL
    if (info->relocatable)
      return TRUE;
  #endif
  
+   globals = elf32_arm_hash_table (info);
    symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
    sym_hashes = elf_sym_hashes (input_bfd);
  
    rel = relocs;
    relend = relocs + input_section->reloc_count;
*************** elf32_arm_relocate_section (bfd *       
*** 3087,3102 ****
        bfd_reloc_status_type        r;
        arelent                      bfd_reloc;
  
        r_symndx = ELF32_R_SYM (rel->r_info);
        r_type   = ELF32_R_TYPE (rel->r_info);
  
        if (   r_type == R_ARM_GNU_VTENTRY
            || r_type == R_ARM_GNU_VTINHERIT)
          continue;
  
!       elf32_arm_info_to_howto (input_bfd, & bfd_reloc, rel);
        howto = bfd_reloc.howto;
  
  #if USE_REL
        if (info->relocatable)
  	{
--- 3089,3107 ----
        bfd_reloc_status_type        r;
        arelent                      bfd_reloc;
  
        r_symndx = ELF32_R_SYM (rel->r_info);
        r_type   = ELF32_R_TYPE (rel->r_info);
+ #ifndef OLD_ARM_ABI
+       r_type = arm_real_reloc_type (globals, r_type);
+ #endif
  
        if (   r_type == R_ARM_GNU_VTENTRY
            || r_type == R_ARM_GNU_VTINHERIT)
          continue;
  
!       bfd_reloc.howto = elf32_arm_howto_from_type (r_type);
        howto = bfd_reloc.howto;
  
  #if USE_REL
        if (info->relocatable)
  	{


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