Preserve a few more bfd fields in check_format_matches
authorAlan Modra <amodra@gmail.com>
Thu, 13 Apr 2023 05:33:16 +0000 (15:03 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 13 Apr 2023 05:33:16 +0000 (15:03 +0930)
commit24a6c5ae36d0ceb0eb77a8b8e40f63ebbbbb052c
tree9e88995249ca84f9664f157a0d6a726172e0923d
parent5d1fefd3b35589d792e5bff800d2bb7e9c4431e2
Preserve a few more bfd fields in check_format_matches

AOUT and COFF targets set symcount and start_address in their object_p
functions.  If these are used anywhere then it would pay to save and
restore them so that a successful match gets the values expected
rather than that for a later unsuccessful target match.

* format.c (struct bfd_preserve): Move some fields.  Add
symcount, read_only and start_address.
(bfd_preserve_save): Save..
(bfd_preserve_restore): ..and restore..
(bfd_reinit): ..and zero new fields.
bfd/format.c