Commit graph

22 commits

Author SHA1 Message Date
Jan Beulich
eb70d820e8 ld/PDB: fix off-by-1 in add_globals_ref()
Copying one too many bytes can corrupt memory, detected/reported by
glibc on a 32-bit distro.
2023-07-11 08:14:57 +02:00
Mark Harmstone
38395c77d7 ld: Sort section contributions in PDB files
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-02-28 00:28:26 +00:00
Mark Harmstone
9a02fbd198 ld: Add pdb support to aarch64-w64-mingw32
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-25 22:26:18 +00:00
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
Mark Harmstone
5c9e42e0e9 ld: Handle LF_VFTABLE types in PDBs 2022-12-31 19:26:23 +10:30
Mark Harmstone
fdf591c4c6 ld: Handle extended-length data structures in PDB types
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-31 19:26:23 +10:30
Mark Harmstone
8d25f5ef2c ld: Write linker symbols in PDB 2022-12-23 21:10:09 +10:30
Mark Harmstone
5d9c033689 ld: Copy other symbols into PDB file 2022-12-23 21:02:21 +10:30
Mark Harmstone
81814b6f5b ld: Write globals stream in PDB 2022-12-23 20:54:40 +10:30
Mark Harmstone
817840046a ld: Parse LF_UDT_SRC_LINE records when creating PDB file 2022-12-23 20:45:30 +10:30
Mark Harmstone
fca9096a94 ld: Write types into IPI stream of PDB 2022-12-23 20:13:31 +10:30
Mark Harmstone
d5b4c0ddb9 ld: Write types into TPI stream of PDB 2022-12-23 20:05:48 +10:30
Mark Harmstone
598c1ae610 ld: Write DEBUG_S_LINES entries in PDB file 2022-12-23 19:57:56 +10:30
Mark Harmstone
8b182dc3c6 ld: Fix segfault in populate_publics_stream 2022-12-23 19:49:47 +10:30
Mark Harmstone
803561cb74 ld: Write DEBUG_S_FILECHKSMS entries in PDBs 2022-12-23 19:37:57 +10:30
Mark Harmstone
f559276dc5 ld: Generate PDB string table 2022-12-23 19:37:44 +10:30
Mark Harmstone
e2a1b0a0d1 ld: Add section contributions substream to PDB files 2022-11-23 01:13:35 +00:00
Mark Harmstone
5967ca921c ld: Add module information substream to PDB files 2022-11-10 04:50:43 +00:00
Mark Harmstone
0882710510 ld: Add publics stream to PDB files 2022-10-31 12:57:26 +10:30
Mark Harmstone
a726722240 ld: Add section header stream to PDB files 2022-10-31 12:57:26 +10:30
Mark Harmstone
3c5e7c6dfc ld: Use %E in einfo in pdb.c
Resubmission, taking into account
https://sourceware.org/pipermail/binutils/2022-October/123948.html.
2022-10-31 12:57:26 +10:30
Mark Harmstone
b41a65333f ld: Add minimal pdb generation 2022-10-20 15:22:37 +10:30