[binutils, ARM, 1/16] Add support for Armv8.1-M Mainline CLI
[deliverable/binutils-gdb.git] / bfd / elf32-bfin.c
index afd316b9802bbaefeb42526cf47423d1c882813f..db052a1ff2898e54bf2d0a013742313d074ebeef 100644 (file)
@@ -1,5 +1,5 @@
 /* ADI Blackfin BFD support for 32-bit ELF.
-   Copyright (C) 2005-2018 Free Software Foundation, Inc.
+   Copyright (C) 2005-2019 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -142,12 +142,12 @@ bfin_pcrel24_reloc (bfd *abfd,
 
 static bfd_reloc_status_type
 bfin_imm16_reloc (bfd *abfd,
-                 arelent *reloc_entry,
-                 asymbol *symbol,
-                 void * data,
-                 asection *input_section,
-                 bfd *output_bfd,
-                 char **error_message ATTRIBUTE_UNUSED)
+                 arelent *reloc_entry,
+                 asymbol *symbol,
+                 void * data,
+                 asection *input_section,
+                 bfd *output_bfd,
+                 char **error_message ATTRIBUTE_UNUSED)
 {
   bfd_vma relocation, x;
   bfd_size_type reloc_addr = reloc_entry->address;
@@ -281,11 +281,11 @@ bfin_byte4_reloc (bfd *abfd,
 static bfd_reloc_status_type
 bfin_bfd_reloc (bfd *abfd,
                arelent *reloc_entry,
-               asymbol *symbol,
-               void * data,
-               asection *input_section,
-               bfd *output_bfd,
-               char **error_message ATTRIBUTE_UNUSED)
+               asymbol *symbol,
+               void * data,
+               asection *input_section,
+               bfd *output_bfd,
+               char **error_message ATTRIBUTE_UNUSED)
 {
   bfd_vma relocation;
   bfd_size_type addr = reloc_entry->address;
@@ -1040,8 +1040,8 @@ static const struct bfin_reloc_map bfin_reloc_map [] =
 };
 
 
-static void
-bfin_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
+static bfd_boolean
+bfin_info_to_howto (bfd *abfd,
                    arelent *cache_ptr,
                    Elf_Internal_Rela *dst)
 {
@@ -1056,7 +1056,15 @@ bfin_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
     cache_ptr->howto = &bfin_gnuext_howto_table [r_type - BFIN_GNUEXT_RELOC_MIN];
 
   else
-    cache_ptr->howto = (reloc_howto_type *) NULL;
+    {
+      /* xgettext:c-format */
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+                         abfd, r_type);
+      bfd_set_error (bfd_error_bad_value);
+      return FALSE;
+    }
+
+  return TRUE;
 }
 
 /* Given a BFD reloc type, return the howto.  */
@@ -1202,9 +1210,7 @@ bfin_check_relocs (bfd * abfd,
        /* This relocation describes which C++ vtable entries
           are actually used.  Record for later use during GC.  */
        case R_BFIN_GNU_VTENTRY:
-         BFD_ASSERT (h != NULL);
-         if (h != NULL
-             && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+         if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
            return FALSE;
          break;
 
@@ -1574,9 +1580,10 @@ bfin_relocate_section (bfd * output_bfd,
        {
          _bfd_error_handler
            /* xgettext:c-format */
-           (_("%pB(%pA+%#Lx): unresolvable relocation against symbol `%s'"),
-            input_bfd,
-            input_section, rel->r_offset, h->root.root.string);
+           (_("%pB(%pA+%#" PRIx64 "): "
+              "unresolvable relocation against symbol `%s'"),
+            input_bfd, input_section, (uint64_t) rel->r_offset,
+            h->root.root.string);
          return FALSE;
        }
 
@@ -1605,8 +1612,9 @@ bfin_relocate_section (bfd * output_bfd,
            {
              _bfd_error_handler
                /* xgettext:c-format */
-               (_("%pB(%pA+%#Lx): reloc against `%s': error %d"),
-                input_bfd, input_section, rel->r_offset, name, (int) r);
+               (_("%pB(%pA+%#" PRIx64 "): reloc against `%s': error %d"),
+                input_bfd, input_section, (uint64_t) rel->r_offset,
+                name, (int) r);
              return FALSE;
            }
        }
@@ -2625,8 +2633,9 @@ bfinfdpic_relocate_section (bfd * output_bfd,
            {
              _bfd_error_handler
                /* xgettext:c-format */
-               (_("%pB: relocation at `%pA+%#Lx' references symbol `%s' with nonzero addend"),
-                input_bfd, input_section, rel->r_offset, name);
+               (_("%pB: relocation at `%pA+%#" PRIx64 "' "
+                  "references symbol `%s' with nonzero addend"),
+                input_bfd, input_section, (uint64_t) rel->r_offset, name);
              return FALSE;
 
            }
@@ -4684,7 +4693,7 @@ bfinfdpic_check_relocs (bfd *abfd, struct bfd_link_info *info,
        bad_reloc:
          _bfd_error_handler
            /* xgettext:c-format */
-           (_("%pB: unsupported relocation type %d"),
+           (_("%pB: unsupported relocation type %#x"),
             abfd, (int) ELF32_R_TYPE (rel->r_info));
          return FALSE;
        }
@@ -5337,7 +5346,7 @@ bfd_bfin_elf32_create_embedded_relocs (bfd *abfd,
       /* We can only relocate absolute longword relocs at run time.  */
       if (ELF32_R_TYPE (irel->r_info) != (int) R_BFIN_BYTE4_DATA)
        {
-         *errmsg = _("unsupported reloc type");
+         *errmsg = _("unsupported relocation type");
          bfd_set_error (bfd_error_bad_value);
          goto error_return;
        }
@@ -5421,7 +5430,7 @@ struct bfd_elf_special_section const elf32_bfin_special_sections[] =
 #define bfd_elf32_bfd_reloc_name_lookup \
                                        bfin_bfd_reloc_name_lookup
 #define elf_info_to_howto              bfin_info_to_howto
-#define elf_info_to_howto_rel          0
+#define elf_info_to_howto_rel          NULL
 #define elf_backend_object_p           elf32_bfin_object_p
 
 #define bfd_elf32_bfd_is_local_label_name \
This page took 0.026251 seconds and 4 git commands to generate.