aboutsummaryrefslogtreecommitdiff
path: root/ld/pdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'ld/pdb.c')
-rw-r--r--ld/pdb.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/ld/pdb.c b/ld/pdb.c
index fcbe325..a15da9d 100644
--- a/ld/pdb.c
+++ b/ld/pdb.c
@@ -2375,6 +2375,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
case LF_POINTER:
{
struct lf_pointer *ptr = (struct lf_pointer *) data;
+ uint32_t attributes;
if (size < offsetof (struct lf_pointer, attributes))
{
@@ -2386,6 +2387,22 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (!remap_type (&ptr->base_type, map, type_num, num_types))
return false;
+ attributes = bfd_getl32 (&ptr->attributes);
+
+ if ((attributes & CV_PTR_MODE_MASK) == CV_PTR_MODE_PMEM
+ || (attributes & CV_PTR_MODE_MASK) == CV_PTR_MODE_PMFUNC)
+ {
+ if (size < offsetof (struct lf_pointer, ptr_to_mem_type))
+ {
+ einfo (_("%P: warning: truncated CodeView type record"
+ " LF_POINTER\n"));
+ return false;
+ }
+
+ if (!remap_type (&ptr->containing_class, map, type_num, num_types))
+ return false;
+ }
+
break;
}