aboutsummaryrefslogtreecommitdiff
path: root/bfd/pdb.c
AgeCommit message (Collapse)AuthorFilesLines
2024-09-05bfd/pdb: fix -Wmaybe-uninitialized warningMark Harmstone1-1/+1
Initialize stream0_start to fix spurious -Wmaybe-uninitialized warning on some versions of gcc.
2024-09-04bfd/pdb: fix bitmap generation in pdb_write_bitmapMark Harmstone1-9/+48
MSVC 2022 is more pedantic than MSVC 2019 when it comes to loading PDB files in readonly mode, and was rejecting PDB files generated by binutils because of their invalid free-space bitmaps. It's unknown what would have happened if you tried to use MS tools to modify a PDB created by binutils, but it probably would have led to a corrupted file. This patch fixes pdb_write_bitmap so we generate files that MSVC will accept. Specifically there were three things we were doing wrong: - We weren't including the superblock (block 0) - We were setting bits in bytes backwards (MSB to LSB, rather than LSB to MSB) - We should have been marking the contents of stream 0 as free. This is because, as the comment says, it's intended to be used for the directory for the previous write, to allow atomic updates.
2024-04-11Remove bfdwin.cAlan Modra1-1/+0
In commit b86d3af60ffc and 0ab0435fe672 I fixed SIGBUS errors found by oss-fuzz now that --with-mmap defaults to enabled. It turns out there are further problems with the aout mmap code: aout_read_minisymbols returns the external symbol array, which is later freed by nm.c. If the array is mmaped you can't free it. Now this could be fixed by making aout minisymbols an array of pointers, but I figure there's not much point in expending effort on that. So delete the aout mmap support along with bfdwin.c and get_section_contents_in_window.
2024-01-04Update year range in copyright notice of binutils filesAlan Modra1-1/+1
Adds two new external authors to etc/update-copyright.py to cover bfd/ax_tls.m4, and adds gprofng to dirs handled automatically, then updates copyright messages as follows: 1) Update cgen/utils.scm emitted copyrights. 2) Run "etc/update-copyright.py --this-year" with an extra external author I haven't committed, 'Kalray SA.', to cover gas testsuite files (which should have their copyright message removed). 3) Build with --enable-maintainer-mode --enable-cgen-maint=yes. 4) Check out */po/*.pot which we don't update frequently.
2023-08-09Rename bfd_bread and bfd_bwriteAlan Modra1-30/+30
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-01-01Update year range in copyright notice of binutils filesAlan Modra1-1/+1
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.
2022-09-28asan: segv in _bfd_archive_close_and_cleanupAlan Modra1-1/+1
Uninitialised arelt_data->parent_cache led to this segv. * pdb.c (pdb_get_elt_at_index): Clear arelt_data.
2022-09-23pdb: _bfd_generic_close_and_cleanupAlan Modra1-1/+6
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-16pdb sanity check block_sizeAlan Modra1-0/+7
* pdb.c (pdb_get_elt_at_index): Only allow block_size to be 512, 1024, 2048, or 4096.
2022-09-13Add pdb archive formatMark Harmstone1-0/+814
Resubmitted with changes in https://sourceware.org/pipermail/binutils/2022-September/122791.html made.