7bed8e7
--- binutils-2.24/bfd/elf64-sh64.c.old
7bed8e7
+++ binutils-2.24/bfd/elf64-sh64.c
7bed8e7
@@ -2894,6 +2894,10 @@ static void
7bed8e7
 sh64_elf64_final_write_processing (bfd *abfd,
7bed8e7
 				   bfd_boolean linker ATTRIBUTE_UNUSED)
7bed8e7
 {
7bed8e7
+  /* PR 17288: Make sure that the SH5 flag is set.  */
7bed8e7
+  if (elf_elfheader (abfd)->e_flags == 0)
7bed8e7
+    elf_elfheader (abfd)->e_flags |= EF_SH5;
7bed8e7
+
7bed8e7
   /* FIXME: Perhaps we shouldn't do this if the entry address was supplied
7bed8e7
      numerically, but we currently lack the infrastructure to recognize
7bed8e7
      that: The entry symbol, and info whether it is numeric or a symbol