public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PATCH: Correct handling of R_ARM_TARGET2 in elf32_arm_relocate_section
@ 2004-11-16  2:48 Mark Mitchell
  2004-11-16  3:32 ` Daniel Jacobowitz
  2004-11-16  9:58 ` Richard Earnshaw
  0 siblings, 2 replies; 5+ messages in thread
From: Mark Mitchell @ 2004-11-16  2:48 UTC (permalink / raw)
  To: binutils


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)
  	{

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-11-16 10:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-16  2:48 PATCH: Correct handling of R_ARM_TARGET2 in elf32_arm_relocate_section Mark Mitchell
2004-11-16  3:32 ` Daniel Jacobowitz
2004-11-16  4:51   ` Mark Mitchell
2004-11-16  9:58 ` Richard Earnshaw
2004-11-16 10:09   ` Mark Mitchell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).