6 Commits

Author SHA1 Message Date
Alan Modra
226f9f4fad Rename bfd_bread and bfd_bwrite
These were renamed from bfd_read and bfd_write back in 2001 when they
lost an unnecessary parameter.  Rename them back, and get rid of a few
casts that are only needed without prototyped functions (K&R C).
2023-08-09 08:48:09 +09:30
Alan Modra
d87bef3a7b Update year range in copyright notice of binutils files
The newer update-copyright.py fixes file encoding too, removing cr/lf
on binutils/bfdtest2.c and ld/testsuite/ld-cygwin/exe-export.exp, and
embedded cr in binutils/testsuite/binutils-all/ar.exp string match.
2023-01-01 21:50:11 +10:30
Alan Modra
540e53422c asan: segv in _bfd_archive_close_and_cleanup
Uninitialised arelt_data->parent_cache led to this segv.

	* pdb.c (pdb_get_elt_at_index): Clear arelt_data.
2022-09-28 10:26:45 +09:30
Alan Modra
22997c77b0 pdb: _bfd_generic_close_and_cleanup
Every format that might appear inside a generic archive needs to call
_bfd_generic_close_and_cleanup, so that the archive element lookup
htab can be tidied on closing an element.  Otherwise you get stale
entries in the htab pointing at freed and perhaps reused memory,
resulting in segfaults when the archive is closed.

Calling _bfd_generic_close_and_cleanup on close means tdata needs to
be set up too, since pdb claims to be of format bfd_archive.

	* pdb.c (pdb_close_and_cleanup): Define as
	_bfd_generic_close_and_cleanup.
	(pdb_archive_p): Set up tdata for bfd_archive format.
2022-09-23 11:56:04 +09:30
Alan Modra
839a4671a9 pdb sanity check block_size
* pdb.c (pdb_get_elt_at_index): Only allow block_size to be
	512, 1024, 2048, or 4096.
2022-09-16 13:05:41 +09:30
Mark Harmstone
6a69b0a180 Add pdb archive format
Resubmitted with changes in
https://sourceware.org/pipermail/binutils/2022-September/122791.html
made.
2022-09-13 10:31:05 +01:00