PR ld/15323
[binutils-gdb.git] / bfd / elf32-metag.c
index 821cea15523fb7411bfa30f20cc2ed7018274f34..8851845384b050a629935c00cc9e381e62d9e788 100644 (file)
@@ -1057,7 +1057,7 @@ elf_metag_link_hash_table_free (struct bfd_link_hash_table *btab)
     = (struct elf_metag_link_hash_table *) btab;
 
   bfd_hash_table_free (&htab->bstab);
-  _bfd_generic_link_hash_table_free (btab);
+  _bfd_elf_link_hash_table_free (btab);
 }
 
 /* Section name for stubs is the associated section name plus this
@@ -2141,6 +2141,10 @@ elf_metag_check_relocs (bfd *abfd,
          while (hh->eh.root.type == bfd_link_hash_indirect
                 || hh->eh.root.type == bfd_link_hash_warning)
            hh = (struct elf_metag_link_hash_entry *) hh->eh.root.u.i.link;
+
+         /* PR15323, ref flags aren't set for references in the same
+            object.  */
+         hh->eh.root.non_ir_ref = 1;
        }
 
       /* Some relocs require a global offset table.  */
@@ -3257,7 +3261,9 @@ elf_metag_post_process_headers (bfd * abfd, struct bfd_link_info * link_info ATT
    dynamic linker, before writing them out.  */
 
 static enum elf_reloc_type_class
-elf_metag_reloc_type_class (const Elf_Internal_Rela *rela)
+elf_metag_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+                           const asection *rel_sec ATTRIBUTE_UNUSED,
+                           const Elf_Internal_Rela *rela)
 {
   switch ((int) ELF32_R_TYPE (rela->r_info))
     {