aboutsummaryrefslogtreecommitdiff
path: root/bfd/vms-alpha.c
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2010-04-16 14:23:41 +0000
committerTristan Gingold <gingold@adacore.com>2010-04-16 14:23:41 +0000
commitddfb684a2fcc454513224bbcfacdc6e708f1b0b2 (patch)
treead5d43dcc4722ea5d2c48d3305be5779d708f65c /bfd/vms-alpha.c
parentbb7835b8e53aaad0111d20020ab2c2c6310405e1 (diff)
downloadfsf-binutils-gdb-ddfb684a2fcc454513224bbcfacdc6e708f1b0b2.zip
fsf-binutils-gdb-ddfb684a2fcc454513224bbcfacdc6e708f1b0b2.tar.gz
fsf-binutils-gdb-ddfb684a2fcc454513224bbcfacdc6e708f1b0b2.tar.bz2
2010-04-16 Tristan Gingold <gingold@adacore.com>
* vms-alpha.c (_bfd_vms_slurp_eihd): Fix typo. (_bfd_vms_get_object_record): Always assume there is a pad byte for alignment. * vms-lib.c: Add a few comments.
Diffstat (limited to 'bfd/vms-alpha.c')
-rw-r--r--bfd/vms-alpha.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/bfd/vms-alpha.c b/bfd/vms-alpha.c
index e213f4ee..65dafa1 100644
--- a/bfd/vms-alpha.c
+++ b/bfd/vms-alpha.c
@@ -492,7 +492,7 @@ _bfd_vms_slurp_eihd (bfd *abfd, unsigned int *eisd_offset,
size, imgtype, (unsigned long)symvva,
*eisd_offset, *eihs_offset));
- return FALSE;
+ return TRUE;
}
/* Read & process EISD record.
@@ -753,15 +753,12 @@ maybe_adjust_record_pointer_for_object (bfd *abfd)
static int
_bfd_vms_get_object_record (bfd *abfd)
{
- unsigned int test_len;
+ unsigned int test_len = 6;
int type;
- int off = 0;
vms_debug2 ((8, "_bfd_vms_get_obj_record\n"));
- test_len = 6;
-
- /* Skip odd alignment byte. */
+ /* Skip alignment byte if the current position is odd. */
if (bfd_tell (abfd) & 1)
{
if (bfd_bread (PRIV (recrd.buf), 1, abfd) != 1)
@@ -769,16 +766,10 @@ _bfd_vms_get_object_record (bfd *abfd)
bfd_set_error (bfd_error_file_truncated);
return -1;
}
- /* Alignment byte may be present or not. This is not easy to
- detect but all object record types are not 0 (on Alpha VMS).
- We also hope that pad byte is 0. */
- if (PRIV (recrd.buf)[0])
- off = 1;
}
/* Read the record header */
- if (bfd_bread (PRIV (recrd.buf) + off, test_len - off, abfd)
- != test_len - off)
+ if (bfd_bread (PRIV (recrd.buf), test_len, abfd) != test_len)
{
bfd_set_error (bfd_error_file_truncated);
return -1;