2010-05-14 Tristan Gingold <gingold@adacore.com>
authorTristan Gingold <gingold@adacore.com>
Fri, 14 May 2010 07:45:02 +0000 (07:45 +0000)
committerTristan Gingold <gingold@adacore.com>
Fri, 14 May 2010 07:45:02 +0000 (07:45 +0000)
* vms-alpha.c (alpha_vms_object_p): Accept header size of 0.
(_bfd_vms_get_object_record): Handle align byte only in the
foreign case.

bfd/ChangeLog
bfd/vms-alpha.c

index 7096709ac7957f2edb783b9bd97350def629cc97..02f9c05184a362a030196a4d70a52a981d1c44b5 100644 (file)
@@ -1,3 +1,9 @@
+2010-05-14  Tristan Gingold  <gingold@adacore.com>
+
+       * vms-alpha.c (alpha_vms_object_p): Accept header size of 0.
+       (_bfd_vms_get_object_record): Handle align byte only in the
+       foreign case.
+
 2010-05-14  Tristan Gingold  <gingold@adacore.com>
 
        * vms-lib.c (_bfd_vms_lib_ia64_archive_p): New function.
index 5ae54c245a95a5dc5c7f48576543ea6edeb23283..c4e4c9cc72f38d579ddc09c5e824ad7824235f6f 100644 (file)
@@ -759,7 +759,7 @@ _bfd_vms_get_object_record (bfd *abfd)
   vms_debug2 ((8, "_bfd_vms_get_obj_record\n"));
 
   /* Skip alignment byte if the current position is odd.  */
-  if (bfd_tell (abfd) & 1)
+  if (PRIV (recrd.file_format) == FF_FOREIGN && (bfd_tell (abfd) & 1))
     {
       if (bfd_bread (PRIV (recrd.buf), 1, abfd) != 1)
         {
@@ -2450,6 +2450,10 @@ alpha_vms_object_p (bfd *abfd)
       /* Extract the header size.  */
       PRIV (recrd.rec_size) = bfd_getl32 (buf + EIHD__L_SIZE);
 
+      /* The header size is 0 for DSF files.  */
+      if (PRIV (recrd.rec_size) == 0)
+        PRIV (recrd.rec_size) = sizeof (struct vms_eihd);
+
       if (PRIV (recrd.rec_size) > PRIV (recrd.buf_size))
         {
           buf = bfd_realloc_or_free (buf, PRIV (recrd.rec_size));
This page took 0.030921 seconds and 4 git commands to generate.