]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* elfxx-mips.c (mips16_stub_symndx): Handle n64 compound relocs.
authorMaciej W. Rozycki <macro@linux-mips.org>
Mon, 16 Apr 2012 11:45:56 +0000 (11:45 +0000)
committerMaciej W. Rozycki <macro@linux-mips.org>
Mon, 16 Apr 2012 11:45:56 +0000 (11:45 +0000)
(_bfd_mips_elf_check_relocs): Update accordingly.

bfd/ChangeLog
bfd/elfxx-mips.c

index ab5fd6fb6bc3fafb3a03ce691928af517346638f..32e6601b6b328106beb8df6575a42d3ecdc3d171 100644 (file)
@@ -1,3 +1,8 @@
+2012-04-16  Maciej W. Rozycki  <macro@linux-mips.org>
+
+       * elfxx-mips.c (mips16_stub_symndx): Handle n64 compound relocs.
+       (_bfd_mips_elf_check_relocs): Update accordingly.
+
 2012-04-13  Alan Modra  <amodra@gmail.com>
 
        PR ld/13947
index 7401d1fd2ac729bd3d85dbe1aa9ea3ccce99c6b8..17c007ad323b8469deda3c0dc285926e3b744288 100644 (file)
@@ -1460,14 +1460,17 @@ section_allows_mips16_refs_p (asection *section)
    function, or 0 if we can't decide which function that is.  */
 
 static unsigned long
-mips16_stub_symndx (asection *sec ATTRIBUTE_UNUSED,
+mips16_stub_symndx (const struct elf_backend_data *bed,
+                   asection *sec ATTRIBUTE_UNUSED,
                    const Elf_Internal_Rela *relocs,
                    const Elf_Internal_Rela *relend)
 {
+  int int_rels_per_ext_rel = bed->s->int_rels_per_ext_rel;
   const Elf_Internal_Rela *rel;
 
-  /* Trust the first R_MIPS_NONE relocation, if any.  */
-  for (rel = relocs; rel < relend; rel++)
+  /* Trust the first R_MIPS_NONE relocation, if any, but not a subsequent
+     one in a compound relocation.  */
+  for (rel = relocs; rel < relend; rel += int_rels_per_ext_rel)
     if (ELF_R_TYPE (sec->owner, rel->r_info) == R_MIPS_NONE)
       return ELF_R_SYM (sec->owner, rel->r_info);
 
@@ -7569,7 +7572,7 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
       /* Look at the relocation information to figure out which symbol
          this is for.  */
 
-      r_symndx = mips16_stub_symndx (sec, relocs, rel_end);
+      r_symndx = mips16_stub_symndx (bed, sec, relocs, rel_end);
       if (r_symndx == 0)
        {
          (*_bfd_error_handler)
@@ -7694,7 +7697,7 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
       /* Look at the relocation information to figure out which symbol
          this is for.  */
 
-      r_symndx = mips16_stub_symndx (sec, relocs, rel_end);
+      r_symndx = mips16_stub_symndx (bed, sec, relocs, rel_end);
       if (r_symndx == 0)
        {
          (*_bfd_error_handler)