/* FRV-specific support for 32-bit ELF.
- Copyright (C) 2002-2018 Free Software Foundation, Inc.
+ Copyright (C) 2002-2019 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
#include "elf/frv.h"
#include "dwarf2.h"
#include "hashtab.h"
+#include "libiberty.h"
/* Forward declarations. */
/* Set the howto pointer for an FRV ELF reloc. */
-static void
+static bfd_boolean
frv_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
arelent *cache_ptr,
Elf_Internal_Rela *dst)
break;
default:
- if (r_type >= (unsigned int) R_FRV_max)
+ if (r_type >= ARRAY_SIZE (elf32_frv_howto_table))
{
/* xgettext:c-format */
_bfd_error_handler (_("%pB: unsupported relocation type %#x"),
abfd, r_type);
- r_type = 0;
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
}
cache_ptr->howto = & elf32_frv_howto_table [r_type];
break;
}
+ return TRUE;
}
/* Set the howto pointer for an FRV ELF REL reloc. */
-static void
+
+static bfd_boolean
frvfdpic_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
arelent *cache_ptr, Elf_Internal_Rela *dst)
{
default:
cache_ptr->howto = NULL;
- break;
+ return FALSE;
}
+ return TRUE;
}
\f
/* Perform a single relocation. By default we use the standard BFD
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_FRV_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;