/* IQ2000-specific support for 32-bit ELF.
- Copyright (C) 2003-2017 Free Software Foundation, Inc.
+ Copyright (C) 2003-2019 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
#include "libbfd.h"
#include "elf-bfd.h"
#include "elf/iq2000.h"
+#include "libiberty.h"
/* Forward declarations. */
\f
/* Set the howto pointer for a IQ2000 ELF reloc. */
-static void
+static bfd_boolean
iq2000_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED,
arelent * cache_ptr,
Elf_Internal_Rela * dst)
break;
default:
- if (r_type >= (unsigned int) R_IQ2000_max)
+ if (r_type >= ARRAY_SIZE (iq2000_elf_howto_table))
{
/* xgettext:c-format */
- _bfd_error_handler (_("%B: invalid IQ2000 reloc number: %d"), abfd, r_type);
- r_type = 0;
+ _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+ abfd, r_type);
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
}
cache_ptr->howto = & iq2000_elf_howto_table [r_type];
break;
}
+ return TRUE;
}
/* Look through the relocs for a section during the first phase.
while (h->root.type == bfd_link_hash_indirect
|| h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
- /* PR15323, ref flags aren't set for references in the same
- object. */
- h->root.non_ir_ref_regular = 1;
}
switch (ELF32_R_TYPE (rel->r_info))
/* This relocation describes which C++ vtable entries
are actually used. Record for later use during GC. */
case R_IQ2000_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;
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, osec) : name;
+ name = name == NULL ? bfd_section_name (osec) : name;
}
else
{
error = TRUE;
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: compiled with %s and linked with modules compiled with %s"),
+ (_("%pB: compiled with %s and linked with modules compiled with %s"),
ibfd, new_opt, old_opt);
}
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"),
- ibfd, (long)new_flags, (long)old_flags);
+ (_("%pB: uses different e_flags (%#x) fields than previous modules (%#x)"),
+ ibfd, new_flags, old_flags);
}
}