https://sourceware.org/bugzilla/show_bug.cgi?id=33858
--- Comment #1 from Sourceware Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Matthieu Longo <[email protected]>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=bf0a637f4d5f73b5242241bcec5a447a7531d5d2 commit bf0a637f4d5f73b5242241bcec5a447a7531d5d2 Author: Matthieu Longo <[email protected]> Date: Fri Jan 30 11:20:02 2026 +0000 Object Attributes v2: clean up attributes data when freeing BFDs Once attributes merge is complete, object attributes from input files are no longer needed and can be safely released. The same applies to object attributes associated to the output object. Ideally, a single clean-up mechanism should handle both inputs and output cases. GNU ld already provides such a mechanism via _bfd_elf_free_cached_info(). The previous patch series that introduced support for Object Attributes v2 did not free any OAv2 data, resulting in leaks of all OAv2-related resources. This patch adds a new helper, _bfd_elf_cleanup_object_attributes, to the OAv2 API to deallocate all OAv2 resources associated with a BFD. The helper is invoked from _bfd_elf_free_cached_info(). The patch also fixes a logical error after the attributes merge, where object attributes were copied from the accumulator into output_bfd. A simple pointer copy is insufficient because ownership of the wrapper must be fully swapped between the two BFDs to ensure resources are deallocated correctly. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33858 Co-authored-by: Alan Modra <[email protected]> -- You are receiving this mail because: You are on the CC list for the bug.
