summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-10-06 18:28:47 +1030
committerAlan Modra <amodra@gmail.com>2021-10-07 14:59:53 +1030
commita281816c8aeb12619d34eec8959a43dfa5c6b4ec (patch)
treef1feb93885106f24c97137dac53734b50bd10cb4
parent163d8077435419ae9ad7fb55503a8005067362a0 (diff)
downloadbinutils-gdb-binutils-2_36-branch.tar.gz
PR28422, build_id use-after-freebinutils-2_36-branch
This fixes a bug in commit 5d9bbb73c1df. All fields preserved from a bfd in struct bfd_preserve need to be cleared in bfd_reinit. PR 28422 * format.c (bfd_reinit): Clear build_id. (cherry picked from commit 6d661cdc5be46e890ed9255e749806f46a88e26c)
-rw-r--r--bfd/format.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/bfd/format.c b/bfd/format.c
index 43bb34135e9..54b63c2ca51 100644
--- a/bfd/format.c
+++ b/bfd/format.c
@@ -151,6 +151,7 @@ bfd_reinit (bfd *abfd, unsigned int section_id, bfd_cleanup cleanup)
abfd->tdata.any = NULL;
abfd->arch_info = &bfd_default_arch_struct;
abfd->flags &= BFD_FLAGS_SAVED;
+ abfd->build_id = NULL;
bfd_section_list_clear (abfd);
}