aboutsummaryrefslogtreecommitdiff
path: root/ld/pdb.c
diff options
context:
space:
mode:
authorMark Harmstone <mark@harmstone.com>2024-07-29 22:19:36 +0100
committerMark Harmstone <mark@harmstone.com>2024-08-01 01:33:34 +0100
commite859b93a8cfbe506f8cce1398dd585bab07499fe (patch)
treeb9204330e83f1b92f918d18c2e0fa80f544fcb17 /ld/pdb.c
parentc2e15bf51978bb020c2e4e142f60896a29e05617 (diff)
downloadbinutils-e859b93a8cfbe506f8cce1398dd585bab07499fe.zip
binutils-e859b93a8cfbe506f8cce1398dd585bab07499fe.tar.gz
binutils-e859b93a8cfbe506f8cce1398dd585bab07499fe.tar.bz2
ld/PDB: handle empty LF_FIELDLIST types
Empty structs in C++ lead to empty LF_FIELDLIST types in the .debug$T section, but we were mistakenly rejecting these as invalid. Allow CodeView types of two bytes, and add a test for this.
Diffstat (limited to 'ld/pdb.c')
-rw-r--r--ld/pdb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ld/pdb.c b/ld/pdb.c
index 7a08ae3..fcbe325 100644
--- a/ld/pdb.c
+++ b/ld/pdb.c
@@ -3582,7 +3582,7 @@ handle_debugt_section (asection *s, bfd *mod, struct types *types,
size = bfd_getl16 (data + off);
off += sizeof (uint16_t);
- if (size + off > s->size || size <= sizeof (uint16_t))
+ if (size + off > s->size || size < sizeof (uint16_t))
{
free (data);
bfd_set_error (bfd_error_bad_value);