arc gas: don't leak arc_opcode_hash memory
authorAlan Modra <amodra@gmail.com>
Thu, 7 Jul 2022 12:39:28 +0000 (22:09 +0930)
committerAlan Modra <amodra@gmail.com>
Sat, 9 Jul 2022 12:05:15 +0000 (21:35 +0930)
commita51628a9d49bf7abb89b71032aa38d7f596be674
treeebd0b9d19c464fa5e51c3c37dbdae165a7d05738
parent654d6f31a644d1381c76d3d70ce3ca9f45a08597
arc gas: don't leak arc_opcode_hash memory

The arc opcode hash table has entries that have a realloc'd field.
This doesn't lend itself to obstack allocation, so freeing must be
done with a purpose built hashtab del_f.

* config/tc-arc.c (arc_opcode_free): New function.
(md_begin): Pass the above as del_f to htab_create_alloc.
(arc_md_end): New function.
* config/tc-arc.h (arc_md_end): Declare.
(md_end): Define.
gas/config/tc-arc.c
gas/config/tc-arc.h