Enable support for the AArch64 dot-prod instruction in the Cortex A55 and A75 cpus.
[deliverable/binutils-gdb.git] / bfd / elf32-m32c.c
index b2db4f5b44018792c0b78948097c5c8e5cb5c7a6..2cb28b21d78d9718a2a7128ed5df8dfc99c7b7c3 100644 (file)
@@ -1,5 +1,5 @@
 /* M16C/M32C specific support for 32-bit ELF.
-   Copyright (C) 2005-2015 Free Software Foundation, Inc.
+   Copyright (C) 2005-2017 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -301,6 +301,7 @@ m32c_info_to_howto_rela
   r_type = ELF32_R_TYPE (dst->r_info);
   if (r_type >= (unsigned int) R_M32C_max)
     {
+      /* xgettext:c-format */
       _bfd_error_handler (_("%B: invalid M32C reloc number: %d"), abfd, r_type);
       r_type = 0;
     }
@@ -399,17 +400,13 @@ m32c_elf_relocate_section
   struct elf_link_hash_entry ** sym_hashes;
   Elf_Internal_Rela *           rel;
   Elf_Internal_Rela *           relend;
-  bfd *dynobj;
   asection *splt;
 
   symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
   sym_hashes = elf_sym_hashes (input_bfd);
   relend     = relocs + input_section->reloc_count;
 
-  dynobj = elf_hash_table (info)->dynobj;
-  splt = NULL;
-  if (dynobj != NULL)
-    splt = bfd_get_linker_section (dynobj, ".plt");
+  splt = elf_hash_table (info)->splt;
 
   for (rel = relocs; rel < relend; rel ++)
     {
@@ -478,12 +475,9 @@ m32c_elf_relocate_section
          else if (h->root.type == bfd_link_hash_undefweak)
            ;
          else if (!bfd_link_relocatable (info))
-           {
-             if (! ((*info->callbacks->undefined_symbol)
-                    (info, h->root.root.string, input_bfd,
-                     input_section, rel->r_offset, TRUE)))
-               return FALSE;
-           }
+           (*info->callbacks->undefined_symbol) (info, h->root.root.string,
+                                                 input_bfd, input_section,
+                                                 rel->r_offset, TRUE);
        }
 
       if (sec != NULL && discarded_section (sec))
@@ -613,15 +607,14 @@ m32c_elf_relocate_section
          switch (r)
            {
            case bfd_reloc_overflow:
-             r = info->callbacks->reloc_overflow
+             (*info->callbacks->reloc_overflow)
                (info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0,
                 input_bfd, input_section, rel->r_offset);
              break;
 
            case bfd_reloc_undefined:
-             r = info->callbacks->undefined_symbol
-               (info, name, input_bfd, input_section, rel->r_offset,
-                TRUE);
+             (*info->callbacks->undefined_symbol)
+               (info, name, input_bfd, input_section, rel->r_offset, TRUE);
              break;
 
            case bfd_reloc_outofrange:
@@ -642,11 +635,8 @@ m32c_elf_relocate_section
            }
 
          if (msg)
-           r = info->callbacks->warning
-             (info, msg, name, input_bfd, input_section, rel->r_offset);
-
-         if (! r)
-           return FALSE;
+           (*info->callbacks->warning) (info, msg, name, input_bfd,
+                                        input_section, rel->r_offset);
        }
     }
 
@@ -699,7 +689,7 @@ m32c_elf_check_relocs
 
          /* PR15323, ref flags aren't set for references in the same
             object.  */
-         h->root.non_ir_ref = 1;
+         h->root.non_ir_ref_regular = 1;
        }
 
       switch (ELF32_R_TYPE (rel->r_info))
@@ -710,20 +700,18 @@ m32c_elf_check_relocs
        case R_M32C_16:
          if (dynobj == NULL)
            elf_hash_table (info)->dynobj = dynobj = abfd;
+         splt = elf_hash_table (info)->splt;
          if (splt == NULL)
            {
-             splt = bfd_get_linker_section (dynobj, ".plt");
-             if (splt == NULL)
-               {
-                 flagword flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS
-                                   | SEC_IN_MEMORY | SEC_LINKER_CREATED
-                                   | SEC_READONLY | SEC_CODE);
-                 splt = bfd_make_section_anyway_with_flags (dynobj, ".plt",
-                                                            flags);
-                 if (splt == NULL
-                     || ! bfd_set_section_alignment (dynobj, splt, 1))
-                   return FALSE;
-               }
+             flagword flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS
+                               | SEC_IN_MEMORY | SEC_LINKER_CREATED
+                               | SEC_READONLY | SEC_CODE);
+             splt = bfd_make_section_anyway_with_flags (dynobj, ".plt",
+                                                        flags);
+             elf_hash_table (info)->splt = splt;
+             if (splt == NULL
+                 || ! bfd_set_section_alignment (dynobj, splt, 1))
+               return FALSE;
            }
 
          if (h != NULL)
@@ -765,14 +753,13 @@ static bfd_boolean
 m32c_elf_finish_dynamic_sections (bfd *abfd ATTRIBUTE_UNUSED,
                                   struct bfd_link_info *info)
 {
-  bfd *dynobj;
-  asection *splt;
+  bfd *dynobj = elf_hash_table (info)->dynobj;
+  asection *splt = elf_hash_table (info)->splt;
 
   /* As an extra sanity check, verify that all plt entries have
      been filled in.  */
 
-  if ((dynobj = elf_hash_table (info)->dynobj) != NULL
-      && (splt = bfd_get_linker_section (dynobj, ".plt")) != NULL)
+  if (dynobj != NULL && splt != NULL)
     {
       bfd_byte *contents = splt->contents;
       unsigned int i, size = splt->size;
@@ -800,7 +787,7 @@ m32c_elf_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
   if (dynobj == NULL)
     return TRUE;
 
-  splt = bfd_get_linker_section (dynobj, ".plt");
+  splt = elf_hash_table (info)->splt;
   BFD_ASSERT (splt != NULL);
 
   splt->contents = (bfd_byte *) bfd_zalloc (dynobj, splt->size);
@@ -824,8 +811,9 @@ m32c_elf_set_private_flags (bfd *abfd, flagword flags)
    object file when linking.  */
 
 static bfd_boolean
-m32c_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
+m32c_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
 {
+  bfd *obfd = info->output_bfd;
   flagword old_flags, old_partial;
   flagword new_flags, new_partial;
   bfd_boolean error = FALSE;
@@ -837,9 +825,10 @@ m32c_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
   old_flags = elf_elfheader (obfd)->e_flags;
 
 #ifdef DEBUG
-  (*_bfd_error_handler) ("old_flags = 0x%.8lx, new_flags = 0x%.8lx, init = %s, filename = %s",
-                        old_flags, new_flags, elf_flags_init (obfd) ? "yes" : "no",
-                        bfd_get_filename (ibfd));
+  _bfd_error_handler
+    ("old_flags = 0x%.8x, new_flags = 0x%.8x, init = %s, filename = %s",
+     old_flags, new_flags, elf_flags_init (obfd) ? "yes" : "no",
+     bfd_get_filename (ibfd));
 #endif
 
   if (!elf_flags_init (obfd))
@@ -883,9 +872,10 @@ m32c_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
       if (new_opt[0])
        {
          error = TRUE;
-         (*_bfd_error_handler)
-           (_("%s: compiled with %s and linked with modules compiled with %s"),
-            bfd_get_filename (ibfd), new_opt, old_opt);
+         _bfd_error_handler
+           /* xgettext:c-format */
+           (_("%B: compiled with %s and linked with modules compiled with %s"),
+            ibfd, new_opt, old_opt);
        }
 
       new_flags &= ~ EF_M32C_ALL_FLAGS;
@@ -895,9 +885,11 @@ m32c_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
       if (new_flags != old_flags)
        {
          error = TRUE;
-         (*_bfd_error_handler)
-           (_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"),
-            bfd_get_filename (ibfd), (long)new_flags, (long)old_flags);
+         _bfd_error_handler
+           /* xgettext:c-format */
+           (_("%B: uses different e_flags (%#x) fields"
+              " than previous modules (%#x)"),
+            ibfd, new_flags, old_flags);
        }
     }
 
@@ -2115,7 +2107,8 @@ m32c_elf_relax_delete_bytes
 \f
 /* This is for versions of gcc prior to 4.3.  */
 static unsigned int
-_bfd_m32c_elf_eh_frame_address_size (bfd *abfd, asection *sec ATTRIBUTE_UNUSED)
+_bfd_m32c_elf_eh_frame_address_size (bfd *abfd,
+                                    const asection *sec ATTRIBUTE_UNUSED)
 {
   if ((elf_elfheader (abfd)->e_flags & EF_M32C_CPU_MASK) == EF_M32C_CPU_M16C)
     return 2;
This page took 0.042503 seconds and 4 git commands to generate.