PR lf/20908
	* elflink.c (bfd_elf_final_link): Check for ELF flavour binaries
	when following indirect links.
 2016-12-02  Nick Clifton  <nickc@redhat.com>
 
+       PR lf/20908
+       * elflink.c (bfd_elf_final_link): Check for ELF flavour binaries
+       when following indirect links.
+
        PR ld/20909
        * aoutx.h (aout_link_add_symbols): Fix off-by-one error in check
        for an illegal string offset.
 
              asection *sec;
 
              sec = p->u.indirect.section;
+             /* See PR 20908 for a reproducer.  */
+             if (bfd_get_flavour (sec->owner) != bfd_target_elf_flavour)
+               {
+                 _bfd_error_handler (_("%B: not in ELF format"), sec->owner);
+                 goto error_return;
+               }
              esdi = elf_section_data (sec);
 
              /* Mark all sections which are to be included in the