forked from Imagelibrary/binutils-gdb
Fix an invalid free called when attempting to link a COFF object against an ELF archive with --no-keep-memory enabled.
PR 22369 * coffgen.c (_bfd_coff_free_symbols): Fail if called on a non-COFF file. * cofflink.c (coff_link_check_archive_element): Skip non-COFF members of an archive.
This commit is contained in:
@@ -212,6 +212,10 @@ coff_link_check_archive_element (bfd *abfd,
|
||||
if (h->type != bfd_link_hash_undefined)
|
||||
return TRUE;
|
||||
|
||||
/* PR 22369 - Skip non COFF objects in the archive. */
|
||||
if (! bfd_family_coff (abfd))
|
||||
return TRUE;
|
||||
|
||||
/* Include this element? */
|
||||
if (!(*info->callbacks->add_archive_element) (info, abfd, name, &abfd))
|
||||
return TRUE;
|
||||
|
||||
Reference in New Issue
Block a user