ld: Check archive only for archive member
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 6 Jul 2021 13:21:54 +0000 (06:21 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 7 Jul 2021 14:44:39 +0000 (07:44 -0700)
commit7a30ac441a4e776e68399cb916c4731b5192e931
tree6c117dae85d6a43e3ec89cbdc8a03751e4d6732c
parentb180e8298b2068c2a530c25d0d6c4f2be651e12e
ld: Check archive only for archive member

Since plugin_maybe_claim calls bfd_close on the original input BFD if it
isn't an archive member, pass NULL to bfd_plugin_close_file_descriptor
to indicate that the BFD isn't an archive member.

bfd/

PR ld/18028
* plugin.c (bfd_plugin_close_file_descriptor): Check archive
only of abfd != NULL.
(try_claim): Pass NULL to bfd_plugin_close_file_descriptor if
it isn't an archive member.

ld/

PR ld/18028
* plugin.c (plugin_input_file): Add comments for abfd and ibfd.
(plugin_object_p): Set input->ibfd to NULL if it isn't an
archive member.
bfd/plugin.c
ld/plugin.c