Don't access freed memory printing objcopy warning
authorAlan Modra <amodra@gmail.com>
Wed, 14 Dec 2022 01:12:00 +0000 (11:42 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 14 Dec 2022 02:37:43 +0000 (13:07 +1030)
commitbd5efa59305b4f84da4d7ece171acf37ee2c99a4
treed0f9b92f5ef1ae3187c76b252448856aafc25f43
parenta4b83845ded201e7d46220213d3e38950c30dbb5
Don't access freed memory printing objcopy warning

abfd->filename will be freed if bfd_close gets far enough to delete
the bfd.  It's possible to have an error from fclose at this point.

* objcopy.c (copy_archive): Dup filename before closing bfd for
potential use in bfd_nonfatal_message.
binutils/objcopy.c