binutils-gdb/include/coff
Alan Modra ce3ab55fa7 ecoff find_nearest_line and final link leaks
Freeing ecoff_debug_info "pointers to the unswapped symbolic info"
isn't a simple matter, due to differing allocation strategies.  In
_bfd_ecoff_slurp_symbolic_info the pointers are to objalloc memory.
In the ecoff linker they are to separately malloc'd memory.  In gas we
have most (obj-elf) or all (obj-ecoff) into a single malloc'd buffer.

This patch fixes the leaks for binutils and ld, leaving the gas leaks
for another day.  The mips elf backend already had this covered, and
the ecoff backend had a pointer, raw_syments used as a flag, so most
of the patch is moving these around a little so they are accessible
for both ecoff and elf.

include/
	* coff/ecoff.h (struct ecoff_debug_info): Add alloc_syments.
bfd/
	* libecoff.h (struct ecoff_tdata): Delete raw_syments.
	* elfxx-mips.c (free_ecoff_debug): Delete.  Replace uses with
	_bfd_ecoff_free_ecoff_debug_info.
	(_bfd_mips_elf_final_link): Init debug.alloc_syments.
	* ecofflink.c (_bfd_ecoff_free_ecoff_debug_info): New function.
	* ecoff.c (_bfd_ecoff_bfd_free_cached_info): Call
	_bfd_ecoff_free_ecoff_debug_info.
	(_bfd_ecoff_slurp_symbolic_info): Replace uses of raw_syments
	with alloc_syments.
	(ecoff_final_link_debug_accumulate): Likewise.  Use
	_bfd_ecoff_free_ecoff_debug_info.
	(_bfd_ecoff_bfd_copy_private_bfd_data): Set alloc_syments for
	copied output.
	* elf64-alpha.c (elf64_alpha_read_ecoff_info): Use
	_bfd_ecoff_free_ecoff_debug_info.
	* libbfd-in.h (_bfd_ecoff_free_ecoff_debug_info): Declare.
	* libbfd.h: Regenerate.
gas/
	* config/obj-ecoff.c (ecoff_frob_file): Set alloc_syments.
	* config/obj-elf.c (elf_frob_file_after_relocs): Likewise.
2023-06-09 12:56:12 +09:30
..
aarch64.h Fix size of external_reloc for pe-aarch64 2023-01-10 23:30:42 +00:00
alpha.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
arm.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ChangeLog-0415
ChangeLog-9103
ecoff.h ecoff find_nearest_line and final link leaks 2023-06-09 12:56:12 +09:30
external.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
i386.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ia64.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
internal.h Use stdint types in coff internal_auxent 2023-03-27 21:58:46 +10:30
loongarch64.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
mcore.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
mips.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
msdos.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
pe.h Define IMAGE_FILE_MACHINE_ARMNT 2023-05-30 12:51:57 +09:30
rs6k64.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
rs6000.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
sh.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
sym.h
symconst.h
ti.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
tic4x.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
tic30.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
tic54x.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
x86_64.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
xcoff.h Re: Keeping track of rs6000-coff archive element pointers 2023-04-28 15:19:59 +09:30
z8k.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
z80.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30