]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
comdat_hash memory leaks
authorAlan Modra <amodra@gmail.com>
Sun, 27 Aug 2023 03:49:01 +0000 (13:19 +0930)
committerAlan Modra <amodra@gmail.com>
Sun, 27 Aug 2023 04:27:42 +0000 (13:57 +0930)
commit8606b47e94078e77a53f3cd714272c853d2add22
treeb823db844fd225ed0889b9bd6849bd5154d40662
parent26d0081b52dc482c59abba23ca495304e698ce4b
comdat_hash memory leaks

Entries added to the hash table with bfd_malloc ought to be freed when
the hash table is deleted.  This patch adds the necessary del_f to the
htab_create call, and delays creating the table until an
IMAGE_SCN_LNK_COMDAT symbol is read.

* peicode.h (pe_mkobject): Move comdat_hash creation..
(htab_hash_flags, htab_eq_flags): ..and these support functions..
* coffcode.h (handle_COMDAT): ..to here, renaming support to
(comdat_hashf, comdat_eqf): ..this and adding..
(comdat_delf): ..this new function.
bfd/coffcode.h
bfd/peicode.h