Check if symbol is defined when converting mov to lea
[binutils-gdb.git] / bfd / elf32-visium.c
index eae67097d1882b2833bb3cc6c8d9b3a63eef2454..52267c3d885479dfba2c5047b8daa9a0822d7e54 100644 (file)
@@ -1,6 +1,6 @@
 /* Visium-specific support for 32-bit ELF.
 
-   Copyright (C) 2003-2014 Free Software Foundation, Inc.
+   Copyright (C) 2003-2015 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -33,11 +33,11 @@ static reloc_howto_type visium_elf_howto_table[] = {
   /* This reloc does nothing.  */
   HOWTO (R_VISIUM_NONE,                /* type */
         0,                     /* rightshift */
-        2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        32,                    /* bitsize */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
+        0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
-        complain_overflow_bitfield,    /* complain_on_overflow */
+        complain_overflow_dont,        /* complain_on_overflow */
         bfd_elf_generic_reloc, /* special_function */
         "R_VISIUM_NONE",       /* name */
         FALSE,                 /* partial_inplace */
@@ -276,32 +276,6 @@ static reloc_howto_type visium_elf_vtentry_howto =
         0,                        /* dst_mask */
         FALSE);                   /* pcrel_offset */
 
-/* Map BFD reloc types to VISIUM ELF reloc types.  */
-struct visium_reloc_map
-{
-  bfd_reloc_code_real_type bfd_reloc_val;
-  unsigned int visium_reloc_val;
-};
-
-static const struct visium_reloc_map visium_reloc_map[] = {
-  {BFD_RELOC_NONE,             R_VISIUM_NONE},
-  {BFD_RELOC_8,                R_VISIUM_8},
-  {BFD_RELOC_16,               R_VISIUM_16},
-  {BFD_RELOC_32,               R_VISIUM_32},
-  {BFD_RELOC_8_PCREL,          R_VISIUM_8_PCREL},
-  {BFD_RELOC_16_PCREL,         R_VISIUM_16_PCREL},
-  {BFD_RELOC_32_PCREL,         R_VISIUM_32_PCREL},
-  {BFD_RELOC_VISIUM_REL16,     R_VISIUM_PC16},
-  {BFD_RELOC_VISIUM_HI16,      R_VISIUM_HI16},
-  {BFD_RELOC_VISIUM_LO16,      R_VISIUM_LO16},
-  {BFD_RELOC_VISIUM_IM16,      R_VISIUM_IM16},
-  {BFD_RELOC_VISIUM_HI16_PCREL,        R_VISIUM_HI16_PCREL},
-  {BFD_RELOC_VISIUM_LO16_PCREL,        R_VISIUM_LO16_PCREL},
-  {BFD_RELOC_VISIUM_IM16_PCREL,        R_VISIUM_IM16_PCREL},
-  {BFD_RELOC_VTABLE_INHERIT,   R_VISIUM_GNU_VTINHERIT},
-  {BFD_RELOC_VTABLE_ENTRY,     R_VISIUM_GNU_VTENTRY},
-};
-
 /* Return the parity bit for INSN shifted to its final position.  */
 
 static bfd_vma
@@ -503,7 +477,7 @@ visium_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr,
     default:
       if (r_type >= (unsigned int) R_VISIUM_max)
        {
-         _bfd_error_handler (_("%A: invalid Visium reloc number: %d"), abfd, r_type);
+         _bfd_error_handler (_("%B: invalid Visium reloc number: %d"), abfd, r_type);
          r_type = 0;
        }
       cache_ptr->howto = &visium_elf_howto_table[r_type];
@@ -524,7 +498,7 @@ visium_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
   const Elf_Internal_Rela *rel;
   const Elf_Internal_Rela *rel_end;
 
-  if (info->relocatable)
+  if (bfd_link_relocatable (info))
     return TRUE;
 
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
@@ -649,7 +623,7 @@ visium_elf_relocate_section (bfd *output_bfd,
          continue;
        }
 
-      if (info->relocatable)
+      if (bfd_link_relocatable (info))
        continue;
 
       switch (r_type)