aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2025-02-13 08:25:01 +1030
committerAlan Modra <amodra@gmail.com>2025-02-14 08:26:42 +1030
commitd1c34b3c05760afac3fbf6b1dd7c7b7a0732275c (patch)
treecbbaf0e6bd04ff66db191269316abe060845246c /gdb/python
parent27c6f1271bacc44552f612ce8a801d725dabb6cf (diff)
downloadbinutils-d1c34b3c05760afac3fbf6b1dd7c7b7a0732275c.zip
binutils-d1c34b3c05760afac3fbf6b1dd7c7b7a0732275c.tar.gz
binutils-d1c34b3c05760afac3fbf6b1dd7c7b7a0732275c.tar.bz2
gas obj-coff memory leaks
This patch addresses memory leaks in gas that show up when running the testsuite on x86_64-w64-mingw32. The seh_ctx_cur, and weak sym naming leaks can occur many times during assembly. The symbol hook and section leaks are not so important since this memory needs to persist until closing the output bfd. * config/obj-coff-seh.c (do_seh_endproc): Free seh_ctx_cur and its fields. * config/obj-coff-seh.h (struct seh_context): Remove unused "next" field. * config/obj-coff.c (coff_obj_symbol_new_hook): Use notes_alloc for aux entries. (coff_obj_symbol_clone_hook): Likewise. (obj_coff_def): Don't strdup name unless we need to do so for tc_canonicalize_symbol_name. Free after making symbol. (weak_name2altname, weak_altname2name): Return a char*. (weak_uniquify): Use notes_concat. (pecoff_obj_set_weak_hook, pecoff_obj_clear_weak_hook): Free name returned by weak_name2altname. (coff_frob_symbol): Similarly for weak_altname2name. (obj_coff_section): Use notes_memdup0. * symbols.h: Add include guard. (notes_memdup0): New inline function.
Diffstat (limited to 'gdb/python')
0 files changed, 0 insertions, 0 deletions