Enable 64-bit archives in ar and ranlib
[deliverable/binutils-gdb.git] / bfd / elf32-crx.c
index f2925f55f392ff6788c790c984bd9e273f374e68..65b9355e3c073620337130ee63fda899d92a44da 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for National Semiconductor's CRX ELF
 /* BFD back-end for National Semiconductor's CRX ELF
-   Copyright (C) 2004-2014 Free Software Foundation, Inc.
+   Copyright (C) 2004-2016 Free Software Foundation, Inc.
    Written by Tomer Levi, NSC, Israel.
 
    This file is part of BFD, the Binary File Descriptor library.
    Written by Tomer Levi, NSC, Israel.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -82,8 +82,8 @@ static reloc_howto_type crx_elf_howto_table[] =
 {
   HOWTO (R_CRX_NONE,           /* type */
         0,                     /* rightshift */
 {
   HOWTO (R_CRX_NONE,           /* type */
         0,                     /* rightshift */
-        2,                     /* size */
-        32,                    /* bitsize */
+        3,                     /* size */
+        0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
         complain_overflow_dont,/* complain_on_overflow */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
         complain_overflow_dont,/* complain_on_overflow */
@@ -423,7 +423,13 @@ elf_crx_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr,
                       Elf_Internal_Rela *dst)
 {
   unsigned int r_type = ELF32_R_TYPE (dst->r_info);
                       Elf_Internal_Rela *dst)
 {
   unsigned int r_type = ELF32_R_TYPE (dst->r_info);
-  BFD_ASSERT (r_type < (unsigned int) R_CRX_MAX);
+  if (r_type >= R_CRX_MAX)
+    {
+      (*_bfd_error_handler) (_("%B: unrecognised CRX reloc number: %d"),
+                            abfd, r_type);
+      bfd_set_error (bfd_error_bad_value);
+      r_type = R_CRX_NONE;
+    }
   cache_ptr->howto = &crx_elf_howto_table[r_type];
 }
 
   cache_ptr->howto = &crx_elf_howto_table[r_type];
 }
 
@@ -876,7 +882,7 @@ elf32_crx_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
        RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
                                         rel, 1, relend, howto, 0, contents);
 
        RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
                                         rel, 1, relend, howto, 0, contents);
 
-      if (info->relocatable)
+      if (bfd_link_relocatable (info))
        continue;
 
       r = crx_elf_final_link_relocate (howto, input_bfd, output_bfd,
        continue;
 
       r = crx_elf_final_link_relocate (howto, input_bfd, output_bfd,
@@ -973,7 +979,7 @@ elf32_crx_relax_section (bfd *abfd, asection *sec,
   /* We don't have to do anything for a relocatable link, if
      this section does not have relocs, or if this is not a
      code section.  */
   /* We don't have to do anything for a relocatable link, if
      this section does not have relocs, or if this is not a
      code section.  */
-  if (link_info->relocatable
+  if (bfd_link_relocatable (link_info)
       || (sec->flags & SEC_RELOC) == 0
       || sec->reloc_count == 0
       || (sec->flags & SEC_CODE) == 0)
       || (sec->flags & SEC_RELOC) == 0
       || sec->reloc_count == 0
       || (sec->flags & SEC_CODE) == 0)
This page took 0.024284 seconds and 4 git commands to generate.