/* Lattice Mico32-specific support for 32-bit ELF
- Copyright (C) 2008-2018 Free Software Foundation, Inc.
+ Copyright (C) 2008-2019 Free Software Foundation, Inc.
Contributed by Jon Beniston <jon@beniston.com>
This file is part of BFD, the Binary File Descriptor library.
/* Set the howto pointer for an Lattice Mico32 ELF reloc. */
-static void
+static bfd_boolean
lm32_info_to_howto_rela (bfd *abfd,
arelent *cache_ptr,
Elf_Internal_Rela *dst)
/* 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 = &lm32_elf_howto_table[r_type];
+ return TRUE;
}
/* Set the right machine number for an Lattice Mico32 ELF file. */
/* Set machine type flags just before file is written out. */
-static void
-lm32_elf_final_write_processing (bfd *abfd, bfd_boolean linker ATTRIBUTE_UNUSED)
+static bfd_boolean
+lm32_elf_final_write_processing (bfd *abfd)
{
elf_elfheader (abfd)->e_machine = EM_LATTICEMICO32;
elf_elfheader (abfd)->e_flags &=~ EF_LM32_MACH;
default:
abort ();
}
+ return _bfd_elf_final_write_processing (abfd);
}
/* Set the GP value for OUTPUT_BFD. Returns FALSE if this is a
const char *msg = NULL;
arelent bfd_reloc;
- lm32_info_to_howto_rela (input_bfd, &bfd_reloc, rel);
+ if (! lm32_info_to_howto_rela (input_bfd, &bfd_reloc, rel))
+ continue;
howto = bfd_reloc.howto;
if (h != NULL)
FALSE, FALSE, TRUE);
if (hend
&& (hend->type == bfd_link_hash_defined
- || hend->type == bfd_link_hash_defweak))
+ || hend->type == bfd_link_hash_defweak)
+ && hend->u.def.section->output_section != NULL)
{
bfd_vma value =
lm32fdpic_fixup32_section (info)->output_section->vma
#define bfd_elf32_bfd_reloc_type_lookup lm32_reloc_type_lookup
#define bfd_elf32_bfd_reloc_name_lookup lm32_reloc_name_lookup
#define elf_info_to_howto lm32_info_to_howto_rela
-#define elf_info_to_howto_rel 0
+#define elf_info_to_howto_rel NULL
#define elf_backend_rela_normal 1
#define elf_backend_object_p lm32_elf_object_p
#define elf_backend_final_write_processing lm32_elf_final_write_processing