Enable the Dot Product extension by default for Armv8.4-a.
[deliverable/binutils-gdb.git] / bfd / elf64-ia64-vms.c
index 152ce32783f5a92f31435b1b71842647f312fce7..8140dc5f3ad6fee2e6da91d498e1bfc8b258a0fd 100644 (file)
@@ -1,6 +1,5 @@
 /* IA-64 support for OpenVMS
-   Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-   2008, 2009, 2010, 2012  Free Software Foundation, Inc.
+   Copyright (C) 1998-2017 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -349,7 +348,7 @@ elf64_ia64_relax_section (bfd *abfd, asection *sec,
      one pass.  */
   *again = FALSE;
 
-  if (link_info->relocatable)
+  if (bfd_link_relocatable (link_info))
     (*link_info->callbacks->einfo)
       (_("%P%F: --relax and -r may not be used together\n"));
 
@@ -539,7 +538,7 @@ elf64_ia64_relax_section (bfd *abfd, asection *sec,
             .plt section.  After the first relaxation pass, linker may
             increase the gap between the .plt and .text sections up
             to 32byte.  We assume linker will always insert 32byte
-            between the .plt and .text sections after the the first
+            between the .plt and .text sections after the first
             relaxation pass.  */
          if (tsec == ia64_info->root.splt)
            offset = -0x1000000 + 32;
@@ -583,9 +582,11 @@ elf64_ia64_relax_section (bfd *abfd, asection *sec,
          if (strcmp (sec->output_section->name, ".init") == 0
              || strcmp (sec->output_section->name, ".fini") == 0)
            {
-             (*_bfd_error_handler)
-               (_("%B: Can't relax br at 0x%lx in section `%A'. Please use brl or indirect branch."),
-                sec->owner, sec, (unsigned long) roff);
+             _bfd_error_handler
+               /* xgettext:c-format */
+               (_("%B: Can't relax br at %#Lx in section `%A'."
+                  " Please use brl or indirect branch."),
+                sec->owner, roff, sec);
              bfd_set_error (bfd_error_bad_value);
              goto error_return;
            }
@@ -859,7 +860,7 @@ elf64_ia64_add_symbol_hook (bfd *abfd,
                            bfd_vma *valp)
 {
   if (sym->st_shndx == SHN_COMMON
-      && !info->relocatable
+      && !bfd_link_relocatable (info)
       && sym->st_size <= elf_gp_size (abfd))
     {
       /* Common symbols less than or equal to -G nn bytes are
@@ -976,40 +977,6 @@ elf64_ia64_local_htab_eq (const void *ptr1, const void *ptr2)
   return entry1->id == entry2->id && entry1->r_sym == entry2->r_sym;
 }
 
-/* Create the derived linker hash table.  The IA-64 ELF port uses this
-   derived hash table to keep information specific to the IA-64 ElF
-   linker (without using static variables).  */
-
-static struct bfd_link_hash_table *
-elf64_ia64_hash_table_create (bfd *abfd)
-{
-  struct elf64_ia64_link_hash_table *ret;
-
-  ret = bfd_zmalloc ((bfd_size_type) sizeof (*ret));
-  if (!ret)
-    return NULL;
-
-  if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
-                                     elf64_ia64_new_elf_hash_entry,
-                                     sizeof (struct elf64_ia64_link_hash_entry),
-                                     IA64_ELF_DATA))
-    {
-      free (ret);
-      return NULL;
-    }
-
-  ret->loc_hash_table = htab_try_create (1024, elf64_ia64_local_htab_hash,
-                                        elf64_ia64_local_htab_eq, NULL);
-  ret->loc_hash_memory = objalloc_create ();
-  if (!ret->loc_hash_table || !ret->loc_hash_memory)
-    {
-      free (ret);
-      return NULL;
-    }
-
-  return &ret->root.root;
-}
-
 /* Free the global elf64_ia64_dyn_sym_info array.  */
 
 static bfd_boolean
@@ -1058,10 +1025,10 @@ elf64_ia64_local_dyn_info_free (void **slot,
 /* Destroy IA-64 linker hash table.  */
 
 static void
-elf64_ia64_hash_table_free (struct bfd_link_hash_table *hash)
+elf64_ia64_link_hash_table_free (bfd *obfd)
 {
   struct elf64_ia64_link_hash_table *ia64_info
-    = (struct elf64_ia64_link_hash_table *) hash;
+    = (struct elf64_ia64_link_hash_table *) obfd->link.hash;
   if (ia64_info->loc_hash_table)
     {
       htab_traverse (ia64_info->loc_hash_table,
@@ -1072,7 +1039,42 @@ elf64_ia64_hash_table_free (struct bfd_link_hash_table *hash)
     objalloc_free ((struct objalloc *) ia64_info->loc_hash_memory);
   elf_link_hash_traverse (&ia64_info->root,
                          elf64_ia64_global_dyn_info_free, NULL);
-  _bfd_generic_link_hash_table_free (hash);
+  _bfd_elf_link_hash_table_free (obfd);
+}
+
+/* Create the derived linker hash table.  The IA-64 ELF port uses this
+   derived hash table to keep information specific to the IA-64 ElF
+   linker (without using static variables).  */
+
+static struct bfd_link_hash_table *
+elf64_ia64_hash_table_create (bfd *abfd)
+{
+  struct elf64_ia64_link_hash_table *ret;
+
+  ret = bfd_zmalloc ((bfd_size_type) sizeof (*ret));
+  if (!ret)
+    return NULL;
+
+  if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
+                                     elf64_ia64_new_elf_hash_entry,
+                                     sizeof (struct elf64_ia64_link_hash_entry),
+                                     IA64_ELF_DATA))
+    {
+      free (ret);
+      return NULL;
+    }
+
+  ret->loc_hash_table = htab_try_create (1024, elf64_ia64_local_htab_hash,
+                                        elf64_ia64_local_htab_eq, NULL);
+  ret->loc_hash_memory = objalloc_create ();
+  if (!ret->loc_hash_table || !ret->loc_hash_memory)
+    {
+      elf64_ia64_link_hash_table_free (abfd);
+      return NULL;
+    }
+  ret->root.root.hash_table_free = elf64_ia64_link_hash_table_free;
+
+  return &ret->root.root;
 }
 
 /* Traverse both local and global hash tables.  */
@@ -1270,12 +1272,13 @@ elf64_ia64_create_dynamic_sections (bfd *abfd,
 
   flags = bed->dynamic_sec_flags;
 
-  s = bfd_make_section_with_flags (abfd, ".dynamic", flags | SEC_READONLY);
+  s = bfd_make_section_anyway_with_flags (abfd, ".dynamic",
+                                         flags | SEC_READONLY);
   if (s == NULL
       || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
     return FALSE;
 
-  s = bfd_make_section_with_flags (abfd, ".plt", flags | SEC_READONLY);
+  s = bfd_make_section_anyway_with_flags (abfd, ".plt", flags | SEC_READONLY);
   if (s == NULL
       || ! bfd_set_section_alignment (abfd, s, bed->plt_alignment))
     return FALSE;
@@ -1287,32 +1290,32 @@ elf64_ia64_create_dynamic_sections (bfd *abfd,
   if (!get_pltoff (abfd, ia64_info))
     return FALSE;
 
-  s = bfd_make_section_with_flags (abfd, ".vmsdynstr",
-                                  (SEC_ALLOC
-                                   | SEC_HAS_CONTENTS
-                                   | SEC_IN_MEMORY
-                                   | SEC_LINKER_CREATED));
+  s = bfd_make_section_anyway_with_flags (abfd, ".vmsdynstr",
+                                         (SEC_ALLOC
+                                          | SEC_HAS_CONTENTS
+                                          | SEC_IN_MEMORY
+                                          | SEC_LINKER_CREATED));
   if (s == NULL
       || !bfd_set_section_alignment (abfd, s, 0))
     return FALSE;
 
   /* Create a fixup section.  */
-  s = bfd_make_section_with_flags (abfd, ".fixups",
-                                   (SEC_ALLOC
-                                    | SEC_HAS_CONTENTS
-                                    | SEC_IN_MEMORY
-                                    | SEC_LINKER_CREATED));
+  s = bfd_make_section_anyway_with_flags (abfd, ".fixups",
+                                         (SEC_ALLOC
+                                          | SEC_HAS_CONTENTS
+                                          | SEC_IN_MEMORY
+                                          | SEC_LINKER_CREATED));
   if (s == NULL
       || !bfd_set_section_alignment (abfd, s, 3))
     return FALSE;
   ia64_info->fixups_sec = s;
 
   /* Create the transfer fixup section.  */
-  s = bfd_make_section_with_flags (abfd, ".transfer",
-                                   (SEC_ALLOC
-                                    | SEC_HAS_CONTENTS
-                                    | SEC_IN_MEMORY
-                                    | SEC_LINKER_CREATED));
+  s = bfd_make_section_anyway_with_flags (abfd, ".transfer",
+                                         (SEC_ALLOC
+                                          | SEC_HAS_CONTENTS
+                                          | SEC_IN_MEMORY
+                                          | SEC_LINKER_CREATED));
   if (s == NULL
       || !bfd_set_section_alignment (abfd, s, 3))
     return FALSE;
@@ -1721,7 +1724,8 @@ get_got (bfd *abfd, struct elf64_ia64_link_hash_table *ia64_info)
 
       /* The .got section is always aligned at 8 bytes.  */
       flags = get_elf_backend_data (dynobj)->dynamic_sec_flags;
-      got = bfd_make_section_with_flags (dynobj, ".got", flags | SEC_SMALL_DATA);
+      got = bfd_make_section_anyway_with_flags (dynobj, ".got",
+                                               flags | SEC_SMALL_DATA);
       if (got == NULL
           || !bfd_set_section_alignment (dynobj, got, 3))
         return NULL;
@@ -1750,13 +1754,14 @@ get_fptr (bfd *abfd, struct bfd_link_info *info,
       if (!dynobj)
        ia64_info->root.dynobj = dynobj = abfd;
 
-      fptr = bfd_make_section_with_flags (dynobj, ".opd",
-                                         (SEC_ALLOC
-                                          | SEC_LOAD
-                                          | SEC_HAS_CONTENTS
-                                          | SEC_IN_MEMORY
-                                          | (info->pie ? 0 : SEC_READONLY)
-                                          | SEC_LINKER_CREATED));
+      fptr = bfd_make_section_anyway_with_flags (dynobj, ".opd",
+                                                (SEC_ALLOC
+                                                 | SEC_LOAD
+                                                 | SEC_HAS_CONTENTS
+                                                 | SEC_IN_MEMORY
+                                                 | (bfd_link_pie (info) ? 0
+                                                    : SEC_READONLY)
+                                                 | SEC_LINKER_CREATED));
       if (!fptr
          || !bfd_set_section_alignment (dynobj, fptr, 4))
        {
@@ -1766,15 +1771,15 @@ get_fptr (bfd *abfd, struct bfd_link_info *info,
 
       ia64_info->fptr_sec = fptr;
 
-      if (info->pie)
+      if (bfd_link_pie (info))
        {
          asection *fptr_rel;
-         fptr_rel = bfd_make_section_with_flags (dynobj, ".rela.opd",
-                                                 (SEC_ALLOC | SEC_LOAD
-                                                  | SEC_HAS_CONTENTS
-                                                  | SEC_IN_MEMORY
-                                                  | SEC_LINKER_CREATED
-                                                  | SEC_READONLY));
+         fptr_rel = bfd_make_section_anyway_with_flags (dynobj, ".rela.opd",
+                                                        (SEC_ALLOC | SEC_LOAD
+                                                         | SEC_HAS_CONTENTS
+                                                         | SEC_IN_MEMORY
+                                                         | SEC_LINKER_CREATED
+                                                         | SEC_READONLY));
          if (fptr_rel == NULL
              || !bfd_set_section_alignment (dynobj, fptr_rel, 3))
            {
@@ -1802,14 +1807,14 @@ get_pltoff (bfd *abfd, struct elf64_ia64_link_hash_table *ia64_info)
       if (!dynobj)
        ia64_info->root.dynobj = dynobj = abfd;
 
-      pltoff = bfd_make_section_with_flags (dynobj,
-                                           ELF_STRING_ia64_pltoff,
-                                           (SEC_ALLOC
-                                            | SEC_LOAD
-                                            | SEC_HAS_CONTENTS
-                                            | SEC_IN_MEMORY
-                                            | SEC_SMALL_DATA
-                                            | SEC_LINKER_CREATED));
+      pltoff = bfd_make_section_anyway_with_flags (dynobj,
+                                                  ELF_STRING_ia64_pltoff,
+                                                  (SEC_ALLOC
+                                                   | SEC_LOAD
+                                                   | SEC_HAS_CONTENTS
+                                                   | SEC_IN_MEMORY
+                                                   | SEC_SMALL_DATA
+                                                   | SEC_LINKER_CREATED));
       if (!pltoff
          || !bfd_set_section_alignment (dynobj, pltoff, 4))
        {
@@ -1849,15 +1854,15 @@ get_reloc_section (bfd *abfd,
   if (!dynobj)
     ia64_info->root.dynobj = dynobj = abfd;
 
-  srel = bfd_get_section_by_name (dynobj, srel_name);
+  srel = bfd_get_linker_section (dynobj, srel_name);
   if (srel == NULL && create)
     {
-      srel = bfd_make_section_with_flags (dynobj, srel_name,
-                                         (SEC_ALLOC | SEC_LOAD
-                                          | SEC_HAS_CONTENTS
-                                          | SEC_IN_MEMORY
-                                          | SEC_LINKER_CREATED
-                                          | SEC_READONLY));
+      srel = bfd_make_section_anyway_with_flags (dynobj, srel_name,
+                                                (SEC_ALLOC | SEC_LOAD
+                                                 | SEC_HAS_CONTENTS
+                                                 | SEC_IN_MEMORY
+                                                 | SEC_LINKER_CREATED
+                                                 | SEC_READONLY));
       if (srel == NULL
          || !bfd_set_section_alignment (dynobj, srel, 3))
        return NULL;
@@ -1919,7 +1924,7 @@ elf64_ia64_check_relocs (bfd *abfd, struct bfd_link_info *info,
   unsigned long r_symndx;
   bfd_boolean maybe_dynamic;
 
-  if (info->relocatable)
+  if (bfd_link_relocatable (info))
     return TRUE;
 
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
@@ -1952,7 +1957,7 @@ elf64_ia64_check_relocs (bfd *abfd, struct bfd_link_info *info,
         locally or externally defined, as not all of the input files
         have yet been processed.  Do something with what we know, as
         this may help reduce memory usage and processing time later.  */
-      maybe_dynamic = (h && ((!info->executable
+      maybe_dynamic = (h && ((!bfd_link_executable (info)
                              && (!SYMBOLIC_BIND (info, h)
                                  || info->unresolved_syms_in_shared_libs == RM_IGNORE))
                             || !h->def_regular
@@ -1993,7 +1998,7 @@ elf64_ia64_check_relocs (bfd *abfd, struct bfd_link_info *info,
        case R_IA64_FPTR32LSB:
        case R_IA64_FPTR64MSB:
        case R_IA64_FPTR64LSB:
-         if (info->shared || h)
+         if (bfd_link_pic (info) || h)
            need_entry = NEED_FPTR | NEED_DYNREL;
          else
            need_entry = NEED_FPTR;
@@ -2044,7 +2049,7 @@ elf64_ia64_check_relocs (bfd *abfd, struct bfd_link_info *info,
        case R_IA64_DIR64MSB:
        case R_IA64_DIR64LSB:
          /* Shared objects will always need at least a REL relocation.  */
-         if (info->shared || maybe_dynamic)
+         if (bfd_link_pic (info) || maybe_dynamic)
            need_entry = NEED_DYNREL;
          break;
 
@@ -2092,6 +2097,9 @@ elf64_ia64_check_relocs (bfd *abfd, struct bfd_link_info *info,
                 || 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_regular = 1;
          h->ref_regular = 1;
        }
       else
@@ -2101,7 +2109,7 @@ elf64_ia64_check_relocs (bfd *abfd, struct bfd_link_info *info,
         locally or externally defined, as not all of the input files
         have yet been processed.  Do something with what we know, as
         this may help reduce memory usage and processing time later.  */
-      maybe_dynamic = (h && ((!info->executable
+      maybe_dynamic = (h && ((!bfd_link_executable (info)
                              && (!SYMBOLIC_BIND (info, h)
                                  || info->unresolved_syms_in_shared_libs == RM_IGNORE))
                             || !h->def_regular
@@ -2138,7 +2146,7 @@ elf64_ia64_check_relocs (bfd *abfd, struct bfd_link_info *info,
        case R_IA64_FPTR32LSB:
        case R_IA64_FPTR64MSB:
        case R_IA64_FPTR64LSB:
-         if (info->shared || h)
+         if (bfd_link_pic (info) || h)
            need_entry = NEED_FPTR | NEED_DYNREL;
          else
            need_entry = NEED_FPTR;
@@ -2184,7 +2192,7 @@ elf64_ia64_check_relocs (bfd *abfd, struct bfd_link_info *info,
        case R_IA64_DIR64MSB:
        case R_IA64_DIR64LSB:
          /* Shared objects will always need at least a REL relocation.  */
-         if (info->shared || maybe_dynamic)
+         if (bfd_link_pic (info) || maybe_dynamic)
            need_entry = NEED_DYNREL;
          dynrel_type = R_IA64_DIR64LSB;
          break;
@@ -2454,7 +2462,7 @@ allocate_dynrel_entries (struct elf64_ia64_dyn_sym_info *dyn_i,
   /* Note that this can't be used in relation to FPTR relocs below.  */
   dynamic_symbol = elf64_ia64_dynamic_symbol_p (dyn_i->h);
 
-  shared = x->info->shared;
+  shared = bfd_link_pic (x->info);
   resolved_zero = (dyn_i->h
                   && ELF_ST_VISIBILITY (dyn_i->h->other)
                   && dyn_i->h->root.type == bfd_link_hash_undefweak);
@@ -2513,7 +2521,7 @@ allocate_dynrel_entries (struct elf64_ia64_dyn_sym_info *dyn_i,
             will be true only if we're actually allocating one statically
             in the main executable.  Position independent executables
             need a relative reloc.  */
-         if (dyn_i->want_fptr && !x->info->pie)
+         if (dyn_i->want_fptr && !bfd_link_pie (x->info))
            continue;
          break;
        case R_IA64_PCREL32LSB:
@@ -2773,11 +2781,11 @@ elf64_ia64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
       unsigned int time_hi, time_lo;
 
       /* The .dynamic section must exist and be empty.  */
-      dynsec = bfd_get_section_by_name (hash_table->dynobj, ".dynamic");
+      dynsec = bfd_get_linker_section (hash_table->dynobj, ".dynamic");
       BFD_ASSERT (dynsec != NULL);
       BFD_ASSERT (dynsec->size == 0);
 
-      dynstrsec = bfd_get_section_by_name (hash_table->dynobj, ".vmsdynstr");
+      dynstrsec = bfd_get_linker_section (hash_table->dynobj, ".vmsdynstr");
       BFD_ASSERT (dynstrsec != NULL);
       BFD_ASSERT (dynstrsec->size == 0);
       dynstrsec->size = 1;     /* Initial blank.  */
@@ -2813,7 +2821,7 @@ elf64_ia64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
         return FALSE;
 
       /* Add entries for shared libraries.  */
-      for (abfd = info->input_bfds; abfd; abfd = abfd->link_next)
+      for (abfd = info->input_bfds; abfd; abfd = abfd->link.next)
         {
           char *soname;
           size_t soname_len;
@@ -2993,13 +3001,13 @@ set_got_entry (bfd *abfd, struct bfd_link_info *info,
       bfd_put_64 (abfd, value, got_sec->contents + got_offset);
 
       /* Install a dynamic relocation if needed.  */
-      if (((info->shared
+      if (((bfd_link_pic (info)
            && (!dyn_i->h
                || ELF_ST_VISIBILITY (dyn_i->h->other) == STV_DEFAULT
                || dyn_i->h->root.type != bfd_link_hash_undefweak))
            || elf64_ia64_dynamic_symbol_p (dyn_i->h))
          && (!dyn_i->want_ltoff_fptr
-             || !info->pie
+             || !bfd_link_pie (info)
              || !dyn_i->h
              || dyn_i->h->root.type != bfd_link_hash_undefweak))
        {
@@ -3103,7 +3111,7 @@ set_pltoff_entry (bfd *abfd, struct bfd_link_info *info,
 
       /* Install dynamic relocations if needed.  */
       if (!is_plt
-         && info->shared
+         && bfd_link_pic (info)
          && (!dyn_i->h
              || ELF_ST_VISIBILITY (dyn_i->h->other) == STV_DEFAULT
              || dyn_i->h->root.type != bfd_link_hash_undefweak))
@@ -3269,10 +3277,10 @@ elf64_ia64_choose_gp (bfd *abfd, struct bfd_link_info *info, bfd_boolean final)
       if (max_short_vma - min_short_vma >= 0x400000)
        {
 overflow:
-         (*_bfd_error_handler)
-           (_("%s: short data segment overflowed (0x%lx >= 0x400000)"),
-            bfd_get_filename (abfd),
-            (unsigned long) (max_short_vma - min_short_vma));
+         _bfd_error_handler
+           /* xgettext:c-format */
+           (_("%B: short data segment overflowed (%#Lx >= 0x400000)"),
+            abfd, max_short_vma - min_short_vma);
          return FALSE;
        }
       else if ((gp_val > min_short_vma
@@ -3280,9 +3288,8 @@ overflow:
               || (gp_val < max_short_vma
                   && max_short_vma - gp_val >= 0x200000))
        {
-         (*_bfd_error_handler)
-           (_("%s: __gp does not cover short data segment"),
-            bfd_get_filename (abfd));
+         _bfd_error_handler
+           (_("%B: __gp does not cover short data segment"), abfd);
          return FALSE;
        }
     }
@@ -3303,7 +3310,7 @@ elf64_ia64_final_link (bfd *abfd, struct bfd_link_info *info)
     return FALSE;
 
   /* Make sure we've got ourselves a nice fat __gp value.  */
-  if (!info->relocatable)
+  if (!bfd_link_relocatable (info))
     {
       bfd_vma gp_val;
       struct elf_link_hash_entry *gp;
@@ -3329,7 +3336,7 @@ elf64_ia64_final_link (bfd *abfd, struct bfd_link_info *info)
      of the .IA_64.unwind section.  Force this section to be relocated
      into memory rather than written immediately to the output file.  */
   unwind_output_sec = NULL;
-  if (!info->relocatable)
+  if (!bfd_link_relocatable (info))
     {
       asection *s = bfd_get_section_by_name (abfd, ELF_STRING_ia64_unwind);
       if (s)
@@ -3386,7 +3393,7 @@ elf64_ia64_relocate_section (bfd *output_bfd,
     return FALSE;
 
   /* Infect various flags from the input section to the output section.  */
-  if (info->relocatable)
+  if (bfd_link_relocatable (info))
     {
       bfd_vma flags;
 
@@ -3419,7 +3426,8 @@ elf64_ia64_relocate_section (bfd *output_bfd,
       r_type = ELF64_R_TYPE (rel->r_info);
       if (r_type > R_IA64_MAX_RELOC_CODE)
        {
-         (*_bfd_error_handler)
+         _bfd_error_handler
+           /* xgettext:c-format */
            (_("%B: unknown relocation type %d"),
             input_bfd, (int) r_type);
          bfd_set_error (bfd_error_bad_value);
@@ -3442,7 +3450,7 @@ elf64_ia64_relocate_section (bfd *output_bfd,
          sym_sec = local_sections[r_symndx];
          msec = sym_sec;
          value = _bfd_elf_rela_local_sym (output_bfd, sym, &msec, rel);
-         if (!info->relocatable
+         if (!bfd_link_relocatable (info)
              && (sym_sec->flags & SEC_MERGE) != 0
              && ELF_ST_TYPE (sym->st_info) == STT_SECTION
              && sym_sec->sec_info_type == SEC_INFO_TYPE_MERGE)
@@ -3489,13 +3497,13 @@ elf64_ia64_relocate_section (bfd *output_bfd,
       else
        {
          bfd_boolean unresolved_reloc;
-         bfd_boolean warned;
+         bfd_boolean warned, ignored;
          struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
 
          RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
                                   r_symndx, symtab_hdr, sym_hashes,
                                   h, sym_sec, value,
-                                  unresolved_reloc, warned);
+                                  unresolved_reloc, warned, ignored);
 
          if (h->root.type == bfd_link_hash_undefweak)
            undef_weak_ref = TRUE;
@@ -3510,7 +3518,7 @@ elf64_ia64_relocate_section (bfd *output_bfd,
        RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
                                         rel, 1, relend, howto, 0, contents);
 
-      if (info->relocatable)
+      if (bfd_link_relocatable (info))
        continue;
 
       hit_addr = contents + rel->r_offset;
@@ -3531,7 +3539,7 @@ elf64_ia64_relocate_section (bfd *output_bfd,
        case R_IA64_DIR64MSB:
        case R_IA64_DIR64LSB:
          /* Install a dynamic relocation for this reloc.  */
-         if ((dynamic_symbol_p || info->shared)
+         if ((dynamic_symbol_p || bfd_link_pic (info))
              && r_symndx != 0
              && (input_section->flags & SEC_ALLOC) != 0)
            {
@@ -3545,8 +3553,10 @@ elf64_ia64_relocate_section (bfd *output_bfd,
                case R_IA64_IMM64:
                  /* ??? People shouldn't be doing non-pic code in
                     shared libraries nor dynamic executables.  */
-                 (*_bfd_error_handler)
-                   (_("%B: non-pic code with imm relocation against dynamic symbol `%s'"),
+                 _bfd_error_handler
+                   /* xgettext:c-format */
+                   (_("%B: non-pic code with imm relocation against"
+                      " dynamic symbol `%s'"),
                     input_bfd,
                     h ? h->root.root.string
                       : bfd_elf_sym_name (input_bfd, symtab_hdr, sym,
@@ -3607,7 +3617,8 @@ elf64_ia64_relocate_section (bfd *output_bfd,
        case R_IA64_GPREL64LSB:
          if (dynamic_symbol_p)
            {
-             (*_bfd_error_handler)
+             _bfd_error_handler
+               /* xgettext:c-format */
                (_("%B: @gprel relocation against dynamic symbol %s"),
                 input_bfd,
                 h ? h->root.root.string
@@ -3651,7 +3662,7 @@ elf64_ia64_relocate_section (bfd *output_bfd,
              if (!undef_weak_ref)
                value = set_fptr_entry (output_bfd, info, dyn_i, value);
            }
-         if (!dyn_i->want_fptr || info->pie)
+         if (!dyn_i->want_fptr || bfd_link_pie (info))
            {
              /* Otherwise, we expect the dynamic linker to create
                 the entry.  */
@@ -3666,7 +3677,7 @@ elf64_ia64_relocate_section (bfd *output_bfd,
                         dynamic symbol table.  */
                      /* ??? People shouldn't be doing non-pic code in
                         shared libraries.  Hork.  */
-                     (*_bfd_error_handler)
+                     _bfd_error_handler
                        (_("%B: linking non-pic code in a position independent executable"),
                         input_bfd);
                      ret_val = FALSE;
@@ -3768,17 +3779,20 @@ elf64_ia64_relocate_section (bfd *output_bfd,
              const char *msg;
 
              if (r_type == R_IA64_PCREL21BI)
+               /* xgettext:c-format */
                msg = _("%B: @internal branch to dynamic symbol %s");
              else if (r_type == R_IA64_PCREL21F || r_type == R_IA64_PCREL21M)
+               /* xgettext:c-format */
                msg = _("%B: speculation fixup to dynamic symbol %s");
              else
+               /* xgettext:c-format */
                msg = _("%B: @pcrel relocation against dynamic symbol %s");
-             (*_bfd_error_handler) (msg, input_bfd,
-                                    h ? h->root.root.string
-                                      : bfd_elf_sym_name (input_bfd,
-                                                          symtab_hdr,
-                                                          sym,
-                                                          sym_sec));
+             _bfd_error_handler (msg, input_bfd,
+                                 h ? h->root.root.string
+                                 : bfd_elf_sym_name (input_bfd,
+                                                     symtab_hdr,
+                                                     sym,
+                                                     sym_sec));
              ret_val = FALSE;
              continue;
            }
@@ -3832,7 +3846,7 @@ elf64_ia64_relocate_section (bfd *output_bfd,
        case R_IA64_IPLTMSB:
        case R_IA64_IPLTLSB:
          /* Install a dynamic relocation for this reloc.  */
-         if ((dynamic_symbol_p || info->shared)
+         if ((dynamic_symbol_p || bfd_link_pic (info))
              && (input_section->flags & SEC_ALLOC) != 0)
            {
               /* VMS: FIXFD ??  */
@@ -3896,10 +3910,9 @@ elf64_ia64_relocate_section (bfd *output_bfd,
            else
              name = bfd_elf_sym_name (input_bfd, symtab_hdr, sym,
                                       sym_sec);
-           if (!(*info->callbacks->warning) (info, _("unsupported reloc"),
-                                             name, input_bfd,
-                                             input_section, rel->r_offset))
-             return FALSE;
+           (*info->callbacks->warning) (info, _("unsupported reloc"),
+                                        name, input_bfd,
+                                        input_section, rel->r_offset);
            ret_val = FALSE;
          }
          break;
@@ -3932,10 +3945,12 @@ elf64_ia64_relocate_section (bfd *output_bfd,
              case R_IA64_LTOFF_TPREL22:
              case R_IA64_LTOFF_DTPMOD22:
              case R_IA64_LTOFF_DTPREL22:
-               (*_bfd_error_handler)
-                 (_("%B: missing TLS section for relocation %s against `%s' at 0x%lx in section `%A'."),
-                  input_bfd, input_section, howto->name, name,
-                  rel->r_offset);
+               _bfd_error_handler
+                 /* xgettext:c-format */
+                 (_("%B: missing TLS section for relocation %s against `%s'"
+                    " at %#Lx in section `%A'."),
+                  input_bfd, howto->name, name,
+                  rel->r_offset, input_section);
                break;
 
              case R_IA64_PCREL21B:
@@ -3947,22 +3962,24 @@ elf64_ia64_relocate_section (bfd *output_bfd,
                    /* Relaxtion is always performed for ELF output.
                       Overflow failures for those relocations mean
                       that the section is too big to relax.  */
-                   (*_bfd_error_handler)
-                     (_("%B: Can't relax br (%s) to `%s' at 0x%lx in section `%A' with size 0x%lx (> 0x1000000)."),
-                      input_bfd, input_section, howto->name, name,
-                      rel->r_offset, input_section->size);
+                   _bfd_error_handler
+                     /* xgettext:c-format */
+                     (_("%B: Can't relax br (%s) to `%s' at %#Lx in section"
+                        " `%A' with size %#Lx (> 0x1000000)."),
+                      input_bfd, howto->name, name, rel->r_offset,
+                      input_section, input_section->size);
                    break;
                  }
+               /* Fall through.  */
              default:
-               if (!(*info->callbacks->reloc_overflow) (info,
-                                                        &h->root,
-                                                        name,
-                                                        howto->name,
-                                                        (bfd_vma) 0,
-                                                        input_bfd,
-                                                        input_section,
-                                                        rel->r_offset))
-                 return FALSE;
+               (*info->callbacks->reloc_overflow) (info,
+                                                   &h->root,
+                                                   name,
+                                                   howto->name,
+                                                   (bfd_vma) 0,
+                                                   input_bfd,
+                                                   input_section,
+                                                   rel->r_offset);
                break;
              }
 
@@ -4027,7 +4044,7 @@ elf64_ia64_finish_dynamic_symbol (bfd *output_bfd,
     }
 
   /* Mark some specially defined symbols as absolute.  */
-  if (strcmp (h->root.root.string, "_DYNAMIC") == 0
+  if (h == ia64_info->root.hdynamic
       || h == ia64_info->root.hgot
       || h == ia64_info->root.hplt)
     sym->st_shndx = SHN_ABS;
@@ -4061,7 +4078,7 @@ elf64_ia64_finish_dynamic_sections (bfd *abfd,
       unsigned int unwind_seg = 0;
       unsigned int code_seg = 0;
 
-      sdyn = bfd_get_section_by_name (dynobj, ".dynamic");
+      sdyn = bfd_get_linker_section (dynobj, ".dynamic");
       BFD_ASSERT (sdyn != NULL);
       dyncon = (Elf64_External_Dyn *) sdyn->contents;
       dynconend = (Elf64_External_Dyn *) (sdyn->contents + sdyn->size);
@@ -4197,8 +4214,9 @@ elf64_ia64_set_private_flags (bfd *abfd, flagword flags)
 /* Merge backend specific data from an object file to the output
    object file when linking.  */
 static bfd_boolean
-elf64_ia64_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
+elf64_ia64_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
 {
+  bfd *obfd = info->output_bfd;
   flagword out_flags;
   flagword in_flags;
   bfd_boolean ok = TRUE;
@@ -4236,7 +4254,7 @@ elf64_ia64_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
 
   if ((in_flags & EF_IA_64_TRAPNIL) != (out_flags & EF_IA_64_TRAPNIL))
     {
-      (*_bfd_error_handler)
+      _bfd_error_handler
        (_("%B: linking trap-on-NULL-dereference with non-trapping files"),
         ibfd);
 
@@ -4245,7 +4263,7 @@ elf64_ia64_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
     }
   if ((in_flags & EF_IA_64_BE) != (out_flags & EF_IA_64_BE))
     {
-      (*_bfd_error_handler)
+      _bfd_error_handler
        (_("%B: linking big-endian files with little-endian files"),
         ibfd);
 
@@ -4254,7 +4272,7 @@ elf64_ia64_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
     }
   if ((in_flags & EF_IA_64_ABI64) != (out_flags & EF_IA_64_ABI64))
     {
-      (*_bfd_error_handler)
+      _bfd_error_handler
        (_("%B: linking 64-bit files with 32-bit files"),
         ibfd);
 
@@ -4263,7 +4281,7 @@ elf64_ia64_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
     }
   if ((in_flags & EF_IA_64_CONS_GP) != (out_flags & EF_IA_64_CONS_GP))
     {
-      (*_bfd_error_handler)
+      _bfd_error_handler
        (_("%B: linking constant-gp files with non-constant-gp files"),
         ibfd);
 
@@ -4273,7 +4291,7 @@ elf64_ia64_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
   if ((in_flags & EF_IA_64_NOFUNCDESC_CONS_GP)
       != (out_flags & EF_IA_64_NOFUNCDESC_CONS_GP))
     {
-      (*_bfd_error_handler)
+      _bfd_error_handler
        (_("%B: linking auto-pic files with non-auto-pic files"),
         ibfd);
 
@@ -4307,7 +4325,9 @@ elf64_ia64_print_private_bfd_data (bfd *abfd, void * ptr)
 }
 
 static enum elf_reloc_type_class
-elf64_ia64_reloc_type_class (const Elf_Internal_Rela *rela)
+elf64_ia64_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+                            const asection *rel_sec ATTRIBUTE_UNUSED,
+                            const Elf_Internal_Rela *rela)
 {
   switch ((int) ELF64_R_TYPE (rela->r_info))
     {
@@ -4732,11 +4752,11 @@ elf64_vms_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
       /* You can't use -r against a dynamic object.  Also, there's no
         hope of using a dynamic object which does not exactly match
         the format of the output file.  */
-      if (info->relocatable
+      if (bfd_link_relocatable (info)
          || !is_elf_hash_table (htab)
          || info->output_bfd->xvec != abfd->xvec)
        {
-         if (info->relocatable)
+         if (bfd_link_relocatable (info))
            bfd_set_error (bfd_error_invalid_operation);
          else
            bfd_set_error (bfd_error_wrong_format);
@@ -4751,7 +4771,7 @@ elf64_vms_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
         so we attach them to this BFD, provided it is the right
         format.  FIXME: If there are no input BFD's of the same
         format as the output, we can't make a shared library.  */
-      if (info->shared
+      if (bfd_link_pic (info)
          && is_elf_hash_table (htab)
          && info->output_bfd->xvec == abfd->xvec
          && !htab->dynamic_sections_created)
@@ -5043,7 +5063,8 @@ error_free_dyn:
        h = (struct elf_link_hash_entry *) h->root.u.i.link;
 
       *sym_hash = h;
-      h->unique_global = (flags & BSF_GNU_UNIQUE) != 0;
+      if (definition)
+       h->unique_global = (flags & BSF_GNU_UNIQUE) != 0;
 
       /* Set the alignment of a common symbol.  */
       if ((common || bfd_is_com_section (sec))
@@ -5112,17 +5133,19 @@ error_free_dyn:
                {
                  /* PR binutils/2735 */
                  if (normal_bfd == NULL)
-                   (*_bfd_error_handler)
+                   _bfd_error_handler
+                     /* xgettext:c-format */
                      (_("Warning: alignment %u of common symbol `%s' in %B"
                         " is greater than the alignment (%u) of its section %A"),
-                      common_bfd, h->root.u.def.section,
-                      1 << common_align, name, 1 << normal_align);
+                      1 << common_align, name, common_bfd,
+                      1 << normal_align, h->root.u.def.section);
                  else
-                   (*_bfd_error_handler)
+                   _bfd_error_handler
+                     /* xgettext:c-format */
                      (_("Warning: alignment %u of symbol `%s' in %B"
                         " is smaller than %u in %B"),
-                      normal_bfd, common_bfd,
-                      1 << normal_align, name, 1 << common_align);
+                      1 << normal_align, name, normal_bfd,
+                      1 << common_align, common_bfd);
                }
            }
 
@@ -5133,12 +5156,11 @@ error_free_dyn:
              if (h->size != 0
                  && h->size != isym->st_size
                  && ! size_change_ok)
-               (*_bfd_error_handler)
+               _bfd_error_handler
+                 /* xgettext:c-format */
                  (_("Warning: size of symbol `%s' changed"
-                    " from %lu in %B to %lu in %B"),
-                  old_bfd, abfd,
-                  name, (unsigned long) h->size,
-                  (unsigned long) isym->st_size);
+                    " from %Lu in %B to %Lu in %B"),
+                  name, h->size, old_bfd, isym->st_size, abfd);
 
              h->size = isym->st_size;
            }
@@ -5160,10 +5182,11 @@ error_free_dyn:
              if (h->type != type)
                {
                  if (h->type != STT_NOTYPE && ! type_change_ok)
-                   (*_bfd_error_handler)
+                   _bfd_error_handler
+                     /* xgettext:c-format */
                      (_("Warning: type of symbol `%s' changed"
                         " from %d to %d in %B"),
-                      abfd, name, h->type, type);
+                      name, h->type, type, abfd);
 
                  h->type = type;
                }
@@ -5352,7 +5375,7 @@ elf64_vms_link_add_archive_symbols (bfd *abfd, struct bfd_link_info *info)
         to include it.  We don't need to check anything.  */
       if (! (*info->callbacks->add_archive_element) (info, element,
                                                      h->root.string, &element))
-       return FALSE;
+       continue;
       if (! elf64_vms_link_add_object_symbols (element, info))
        return FALSE;
 
@@ -5450,8 +5473,6 @@ static const struct elf_size_info elf64_ia64_vms_size_info = {
 /* Stuff for the BFD linker: */
 #define bfd_elf64_bfd_link_hash_table_create \
        elf64_ia64_hash_table_create
-#define bfd_elf64_bfd_link_hash_table_free \
-       elf64_ia64_hash_table_free
 #define elf_backend_create_dynamic_sections \
        elf64_ia64_create_dynamic_sections
 #define elf_backend_check_relocs \
@@ -5504,7 +5525,7 @@ static const struct elf_size_info elf64_ia64_vms_size_info = {
 /* VMS-specific vectors.  */
 
 #undef  TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM              bfd_elf64_ia64_vms_vec
+#define TARGET_LITTLE_SYM              ia64_elf64_vms_vec
 #undef  TARGET_LITTLE_NAME
 #define TARGET_LITTLE_NAME             "elf64-ia64-vms"
 #undef  TARGET_BIG_SYM
This page took 0.049553 seconds and 4 git commands to generate.