aboutsummaryrefslogtreecommitdiff
path: root/ld/pdb.c
AgeCommit message (Collapse)AuthorFilesLines
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-11warn unused result for bfd IO functionsAlan Modra1-5/+5
This patch fixes all the warnings I found in bfd, binutils and ld, plus some bitrotted COFF_GO32 code that tried to allocate -168ul bytes. When the malloc fail was reported these testsuite fails resulted: i386-go32 +FAIL: go32 stub i386-go32 +ERROR: tcl error sourcing /home/alan/src/binutils-gdb/ld/testsuite/ld-i386/i386.exp. i386-go32 +ERROR: couldn't open "tmpdir/go32stub": no such file or directory i386-go32 +FAIL: ld-scripts/sane1 i386-go32 +FAIL: ld-scripts/assign-loc i386-go32 +FAIL: ld-scripts/pr18963 This does result in some warnings in gdb which are fixed in a followup patch. bfd/ * bfdio.c (bfd_read, bfd_write): Add ATTRIBUTE_WARN_UNUSED_RESULT. (bfd_tell, bfd_stat, bfd_seek, bfd_mmap): Likewise. * bfd-in2.h: Regenerate. * coff-rs6000.c (xcoff_write_armap_big) Don't ignore bfd_write return value. (xcoff_generate_rtinit): Likewise. Also free data_buffer and string_table before returning. * coff64-rs6000.c (xcoff64_generate_rtinit): Likewise. * coff-stgo32.c (go32exe_check_format): Don't ignore bfd_seek return value. * coffcode.h (coff_apply_checksum): Don't ignore bfd_write return. (coff_write_object_contents <COFF_GO32>): Likewise, and bfd_malloc. Fix bitrotted code to look for first section with non-zero filepos. * elf64-ia64-vms.c (elf64_vms_write_shdrs_and_ehdr): Don't ignore bfd_seek or bfd_write return values. * pef.c (bfd_pef_scan_section): Likewise. (bfd_pef_read_header, bfd_pef_xlib_read_header): Likewise. * vms-misc.c (_bfd_vms_output_end): Likewise. Return status. * vms.h (_bfd_vms_output_end): Update prototype. * vms-alpha.c: Pass _bfd_vms_output_end status up call chains. * wasm-module.c (wasm_compute_custom_section_file_position): Don't ignore bfd_seek or bfd_write return values. (wasm_compute_section_file_positions): Likewise. * xsym.c (bfd_sym_scan): Don't ignore bfd_seek return value. (bfd_sym_read_name_table): Likewise. binutils/ * ar.c (print_contents, extract_file): Don't ignore bfd_seek return value. ld/ * pdb.c (create_section_contrib_substream): Don't ignore bfd_seek return value. (create_section_header_stream): Likewise. * pe-dll.c (pe_get16, pe_get32): Add fail param to return results from bfd_seek and bfd_read. (pe_implied_import_dll): Handle these fails, and other bfd_seek and bfd_read return values.
2023-08-09Rename bfd_bread and bfd_bwriteAlan Modra1-54/+54
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-07-11ld/PDB: fix off-by-1 in add_globals_ref()Jan Beulich1-1/+1
Copying one too many bytes can corrupt memory, detected/reported by glibc on a 32-bit distro.
2023-02-28ld: Sort section contributions in PDB filesMark Harmstone1-19/+63
Microsoft's DIA library, and thus also MSVC and WinDbg, expects section contributions to be ordered by section number and offset, otherwise it's unable to resolve line numbers.
2023-01-25ld: Add pdb support to aarch64-w64-mingw32Mark Harmstone1-11/+25
This extends PDB support to the aarch64 PE targets. The changes to the test files are just to make it so they can be assembled as either x86, x86_64, or aarch64, mainly by changing the comment style. The only actual code change here is in adding the architecture constants to pdb.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-12-31ld: Handle LF_VFTABLE types in PDBsMark Harmstone1-0/+20
2022-12-31ld: Handle extended-length data structures in PDB typesMark Harmstone1-23/+205
A few fixes to minor issues I've discovered in my PDB patches. * If sizes or offsets are greater than 0x8000, they get encoded as extended values in the same way as for enum values - e.g. a LF_ULONG .short followed by a .long. * I've managed to coax MSVC to produce another type, LF_VFTABLE, which is seen when dealing with COM. I don't think LLVM emits this. Note that we can't just implement everything in Microsoft's header files, as most of it is obsolete. * Fixes a stupid bug in the test program, where I was adding an index to a size. The index was hard-coded to 0, so this didn't cause any actual issues.
2022-12-23ld: Write linker symbols in PDBMark Harmstone1-34/+208
2022-12-23ld: Copy other symbols into PDB fileMark Harmstone1-0/+362
2022-12-23ld: Write globals stream in PDBMark Harmstone1-40/+960
2022-12-23ld: Parse LF_UDT_SRC_LINE records when creating PDB fileMark Harmstone1-10/+161
2022-12-23ld: Write types into IPI stream of PDBMark Harmstone1-17/+187
2022-12-23ld: Write types into TPI stream of PDBMark Harmstone1-22/+1268
2022-12-23ld: Write DEBUG_S_LINES entries in PDB fileMark Harmstone1-4/+107
2022-12-23ld: Fix segfault in populate_publics_streamMark Harmstone1-0/+3
2022-12-23ld: Write DEBUG_S_FILECHKSMS entries in PDBsMark Harmstone1-12/+419
2022-12-23ld: Generate PDB string tableMark Harmstone1-6/+290
2022-11-23ld: Add section contributions substream to PDB filesMark Harmstone1-3/+109
2022-11-10ld: Add module information substream to PDB filesMark Harmstone1-4/+210
2022-10-31ld: Add publics stream to PDB filesMark Harmstone1-6/+341
2022-10-31ld: Add section header stream to PDB filesMark Harmstone1-3/+66
2022-10-31ld: Use %E in einfo in pdb.cMark Harmstone1-10/+9
Resubmission, taking into account https://sourceware.org/pipermail/binutils/2022-October/123948.html.
2022-10-20ld: Add minimal pdb generationMark Harmstone1-0/+522