summaryrefslogtreecommitdiff
path: root/bfd/vms-lib.c
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2010-05-03 16:04:29 +0000
committerTristan Gingold <gingold@adacore.com>2010-05-03 16:04:29 +0000
commitde6d05ef06ec6fe2a3bb6923003c3f392c9be264 (patch)
tree3d681be99d61944889e7e0adb7e0b10373004b55 /bfd/vms-lib.c
parentff0ad51652dffcec11dcee57e70b7a764f9ae431 (diff)
downloadbinutils-redhat-de6d05ef06ec6fe2a3bb6923003c3f392c9be264.tar.gz
bfd/
2010-05-03 Tristan Gingold <gingold@adacore.com> * vms-lib.c (vms_lib_bopen): Fix the size threshold to read selective_search flag. Add comments. * vms-alpha.c (alpha_vms_bfd_final_link): Create the DMT section before output_has_begun is set.
Diffstat (limited to 'bfd/vms-lib.c')
-rw-r--r--bfd/vms-lib.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bfd/vms-lib.c b/bfd/vms-lib.c
index bbef19c7f4..0b45a131b8 100644
--- a/bfd/vms-lib.c
+++ b/bfd/vms-lib.c
@@ -577,6 +577,7 @@ _bfd_vms_lib_archive_p (bfd *abfd, enum vms_lib_kind kind)
off = bfd_getl16 (sbm->next);
if (off != 0)
{
+ /* Read the 'next' array. */
sbmdesc->next = (unsigned short *)bfd_alloc
(abfd, sbm_len * sizeof (unsigned short));
buf1 = data + off;
@@ -585,6 +586,7 @@ _bfd_vms_lib_archive_p (bfd *abfd, enum vms_lib_kind kind)
}
else
{
+ /* There is no next array if there is only one submap. */
BFD_ASSERT (tdata->nbr_dcxsbm == 1);
sbmdesc->next = NULL;
}
@@ -1200,7 +1202,7 @@ vms_lib_bopen (bfd *el, file_ptr filepos)
/* Check id. */
if (mhd->id != MHD__C_MHDID)
return FALSE;
- if (len >= sizeof (struct vms_mhd))
+ if (len >= MHD__C_MHDLEN + 1)
el->selective_search = (mhd->objstat & MHD__M_SELSRC) ? 1 : 0;
el->mtime = vms_rawtime_to_time_t (mhd->datim);
el->mtime_set = TRUE;