]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
binary outsymbols
authorAlan Modra <amodra@gmail.com>
Thu, 16 Jan 2025 04:21:56 +0000 (14:51 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 16 Jan 2025 09:27:19 +0000 (19:57 +1030)
commit6ca01b0bdd59b61cf94ed151c85f7dee9d240158
treea4e17e4be2747e51cf3cd46878517a16eeb31610
parent394a3f4f8dce6c508e289575359268ee793d59c9
binary outsymbols

This fixes leaks of outsymbols for various targets that use the
generic linker.  The key fix here is to not generate output symbols
for targets that won't ever write symbols, and of course to free
outsymbols after they've been written in targets that do.  Target
vector object_flags and section_flags are updated to better reflect
target capabilities, in particular not setting HAS_SYMS or SEC_RELOC
when the target does not support symbols or relocs.

* binary.c (binary_vec): Update section_flags.
* linker.c (generic_add_output_symbol): Don't add to
outsymbols if !HAS_SYMS.
* srec.c (srec_write_symbols): Free outsymbols on return.
(srec_vec): Update object_flags and section_flags.
(symbolsrec_vec): Likewise.
* tekhex.c (tekhex_write_object_contents): Free outsymbols on
return.
(tekhex_vec): Update object_flags and section_flags.
* verilog.c (verilog_vec): Likewise.
bfd/binary.c
bfd/linker.c
bfd/srec.c
bfd/tekhex.c
bfd/verilog.c