diff options
author | Alan Modra <amodra@gmail.com> | 2022-12-23 09:27:14 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2022-12-23 10:35:38 +1030 |
commit | 160a943ff8aa0dd9105164f10d4bfca9db872999 (patch) | |
tree | f8f86d35b0a0d504dae87b91f67d9b4e0472cae9 /ld/testsuite | |
parent | 2ac6aa431ecf8bf6afdc18020f3d6e55458df223 (diff) | |
download | binutils-160a943ff8aa0dd9105164f10d4bfca9db872999.zip binutils-160a943ff8aa0dd9105164f10d4bfca9db872999.tar.gz binutils-160a943ff8aa0dd9105164f10d4bfca9db872999.tar.bz2 |
COFF build-id writes uninitialised data to file
1) The first write in write_build_id wrote rubbish past the struct
external_IMAGE_DEBUG_DIRECTORY, which was later overwritten with
correct data. No user visible problem there, except that tools like
valgrind complain.
2) The size for the pdb name was incorrectly calculated.
* emultempl/pe.em (write_build_id): Write the debug directory,
not the entire section contents.
(setup_build_id): Add size for the base name of pdb_name, not
the full path.
* emultempl/pep.em: Likewise.
* testsuite/ld-pe/pdb2-section-contrib.d: Update.
Diffstat (limited to 'ld/testsuite')
-rw-r--r-- | ld/testsuite/ld-pe/pdb2-section-contrib.d | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ld/testsuite/ld-pe/pdb2-section-contrib.d b/ld/testsuite/ld-pe/pdb2-section-contrib.d index 3afeb14..dd94372 100644 --- a/ld/testsuite/ld-pe/pdb2-section-contrib.d +++ b/ld/testsuite/ld-pe/pdb2-section-contrib.d @@ -4,7 +4,7 @@ tmpdir/pdb2-sc: file format binary Contents of section .data: 0000 2dba2ef1 01000000 00000000 10000000 -............... 0010 20000060 00000000 00000000 00000000 ..`............ - 0020 02000000 00000000 44000000 40000040 ........D...@..@ + 0020 02000000 00000000 3d000000 40000040 ........=...@..@ 0030 00000000 00000000 00000000 01000000 ................ 0040 10000000 10000000 20000060 01000000 ........ ..`.... 0050 00000000 00000000 04000000 00000000 ................ |