-#define USE_RELA /* Only USE_REL is actually significant, but this is
- here are a reminder... */
-
-static void mcore_elf_howto_init
- PARAMS ((void));
-static reloc_howto_type * mcore_elf_reloc_type_lookup
- PARAMS ((bfd *, bfd_reloc_code_real_type));
-static void mcore_elf_info_to_howto
- PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *));
-static boolean mcore_elf_set_private_flags
- PARAMS ((bfd *, flagword));
-static boolean mcore_elf_merge_private_bfd_data
- PARAMS ((bfd *, bfd *));
-static bfd_reloc_status_type mcore_elf_unsupported_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-static boolean mcore_elf_relocate_section
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
- Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
-static asection * mcore_elf_gc_mark_hook
- PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *,
- struct elf_link_hash_entry *, Elf_Internal_Sym *));
-static boolean mcore_elf_gc_sweep_hook
- PARAMS ((bfd *, struct bfd_link_info *, asection *,
- const Elf_Internal_Rela *));
-static boolean mcore_elf_check_relocs
- PARAMS ((bfd *, struct bfd_link_info *, asection *,
- const Elf_Internal_Rela *));
+/* RELA relocs are used here... */
+
+/* Function to set whether a module needs the -mrelocatable bit set. */
+
+static bfd_boolean
+mcore_elf_set_private_flags (bfd * abfd, flagword flags)
+{
+ BFD_ASSERT (! elf_flags_init (abfd)
+ || elf_elfheader (abfd)->e_flags == flags);
+
+ elf_elfheader (abfd)->e_flags = flags;
+ elf_flags_init (abfd) = TRUE;
+ return TRUE;
+}
+
+/* Merge backend specific data from an object file to the output
+ object file when linking. */
+
+static bfd_boolean
+mcore_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
+{
+ bfd *obfd = info->output_bfd;
+ flagword old_flags;
+ flagword new_flags;
+
+ /* Check if we have the same endianness. */
+ if (! _bfd_generic_verify_endian_match (ibfd, info))
+ return FALSE;
+
+ if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour
+ || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
+ return TRUE;
+
+ new_flags = elf_elfheader (ibfd)->e_flags;
+ old_flags = elf_elfheader (obfd)->e_flags;
+
+ if (! elf_flags_init (obfd))
+ {
+ /* First call, no flags set. */
+ elf_flags_init (obfd) = TRUE;
+ elf_elfheader (obfd)->e_flags = new_flags;
+ }
+ else if (new_flags == old_flags)
+ /* Compatible flags are OK. */
+ ;
+ else
+ {
+ /* FIXME */
+ }
+
+ return TRUE;
+}
+\f
+/* Don't pretend we can deal with unsupported relocs. */
+
+static bfd_reloc_status_type
+mcore_elf_unsupported_reloc (bfd * abfd,
+ arelent * reloc_entry,
+ asymbol * symbol ATTRIBUTE_UNUSED,
+ void * data ATTRIBUTE_UNUSED,
+ asection * input_section ATTRIBUTE_UNUSED,
+ bfd * output_bfd ATTRIBUTE_UNUSED,
+ char ** error_message ATTRIBUTE_UNUSED)
+{
+ BFD_ASSERT (reloc_entry->howto != (reloc_howto_type *)0);
+
+ /* xgettext:c-format */
+ _bfd_error_handler (_("%B: Relocation %s (%d) is not currently supported.\n"),
+ abfd,
+ reloc_entry->howto->name,
+ reloc_entry->howto->type);
+
+ return bfd_reloc_notsupported;
+}