Fix build on recent versions of OpenBSD.
[deliverable/binutils-gdb.git] / bfd / elf64-sh64.c
index ce5436d0d948668ba489b96753db55e515cb376e..10a9396e95b3d94142362761fa61417b25a6a17f 100644 (file)
@@ -2286,8 +2286,8 @@ sh_elf64_copy_private_data_internal (bfd *ibfd, bfd *obfd)
     }
 
   /* Copy object attributes.  */
-  _bfd_elf_copy_obj_attributes (ibfd, obfd);
-
+  _bfd_elf_copy_private_bfd_data (ibfd, obfd);
+  
   return sh_elf64_set_private_flags (obfd, elf_elfheader (ibfd)->e_flags);
 }
 
@@ -2424,6 +2424,10 @@ sh_elf64_check_relocs (bfd *abfd, struct bfd_link_info *info,
          while (h->root.type == bfd_link_hash_indirect
                 || h->root.type == bfd_link_hash_warning)
            h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+         /* PR15323, ref flags aren't set for references in the same
+            object.  */
+         h->root.non_ir_ref = 1;
        }
 
       /* Some relocs require a global offset table.  */
@@ -3069,7 +3073,7 @@ sh64_elf64_link_hash_table_create (bfd *abfd)
 {
   struct elf_link_hash_table *ret;
 
-  ret = (struct elf_link_hash_table *) bfd_malloc (sizeof (* ret));
+  ret = (struct elf_link_hash_table *) bfd_zmalloc (sizeof (* ret));
   if (ret == (struct elf_link_hash_table *) NULL)
     return NULL;
 
@@ -3769,7 +3773,7 @@ sh64_elf64_finish_dynamic_symbol (bfd *output_bfd,
     }
 
   /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute.  */
-  if (strcmp (h->root.root.string, "_DYNAMIC") == 0
+  if (h == elf_hash_table (info)->hdynamic
       || h == elf_hash_table (info)->hgot)
     sym->st_shndx = SHN_ABS;
 
This page took 0.032658 seconds and 4 git commands to generate.