]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Use bfd id to validate dwarf2 cache
authorAlan Modra <amodra@gmail.com>
Wed, 11 Dec 2024 02:31:23 +0000 (13:01 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 12 Dec 2024 05:34:51 +0000 (16:04 +1030)
commit338c58cac6ea08a8ec90a06496054fcf9e45d094
treea3f481b55aa0f04a6e3b03d80c26f8fae2e356f0
parent4d72d1027143d8a63f5e61d36516cb6846d7c71b
Use bfd id to validate dwarf2 cache

Using a bfd pointer to validate the cache isn't very robust.  If a bfd
is closed somehow without clearing the cache, then it's possible that
another bfd is opened using the same memory and thus orig_bfd compares
equal to the new bfd.

* dwarf2.c (struct dwarf2_debug): Add orig_bfd_id.  Delete
orig_bfd.
(_bfd_dwarf2_slurp_debug_info): Validate stash with orig_bfd_id.
bfd/dwarf2.c