aboutsummaryrefslogtreecommitdiff
path: root/libctf
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2025-01-11 16:19:09 +1030
committerAlan Modra <amodra@gmail.com>2025-01-20 07:13:46 +1030
commitd4115c2c8d447e297ae353892de89192c1996211 (patch)
tree70735869906bc8702c11e0cca53a847da2fe8b1f /libctf
parentf7b0dfe03050f86062b8400f22c2a3e01eb0208c (diff)
downloadbinutils-d4115c2c8d447e297ae353892de89192c1996211.zip
binutils-d4115c2c8d447e297ae353892de89192c1996211.tar.gz
binutils-d4115c2c8d447e297ae353892de89192c1996211.tar.bz2
Replace xmalloc with stat_alloc in ld parser
A few place dealing with ld script handling made some attempt to free memory, but this was generally ignored and would be quite a lot of work to implement. Instead, use the stat_obstack rather than mallocing in many more cases. * ldexp.c (exp_get_fill): Use stat_alloc for fill. * ldfile.c (ldfile_try_open_bfd): Don't free yylval fields. * ldgram.y: Replace xmalloc with stat_alloc throughout. * ldlang.c (stat_memdup, stat_strdup): New functions. (ldirname): Use stat_memdup. Don't strdup ".". (output_section_callback_sort): Use stat_alloc. (output_section_callback_tree_to_list): Don't free. (lang_memory_region_lookup): Use stat_strdup. (lang_memory_region_alias): Likewise. (add_excluded_libs): Use stat_alloc and stat_memdup. (ldlang_add_undef, ldlang_add_require_defined): Use stat_strdup. (lang_add_nocrossref, lang_leave_overlay): Use stat_alloc. (realsymbol): Use stat_strdup for return value and always free symbol. (lang_new_vers_pattern, lang_new_vers_node): Use stat_alloc. (lang_finalize_version_expr_head): Don't free. Delete FIXME. (lang_register_vers_node): Don't free. (lang_add_vers_depend): Use stat_alloc. (lang_do_version_exports_section): Likewise. (lang_add_unique): Use stat_alloc and stat_strdup. (lang_append_dynamic_list): Use stat_alloc. * ldlang.h (stat_memdup, stat_strdup): Declare. * ldlex.l: Replace xstrdup with stat_strdup throughout. Replace xmemdup with stat_memdup too. * lexsup.c (parse_args): Don't free export list or dynamic list.
Diffstat (limited to 'libctf')
0 files changed, 0 insertions, 0 deletions