aboutsummaryrefslogtreecommitdiff
path: root/bfd/vms-lib.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-lib.c
parentbb7835b8e53aaad0111d20020ab2c2c6310405e1 (diff)
downloadgdb-ddfb684a2fcc454513224bbcfacdc6e708f1b0b2.zip
gdb-ddfb684a2fcc454513224bbcfacdc6e708f1b0b2.tar.gz
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-lib.c')
-rw-r--r--bfd/vms-lib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/bfd/vms-lib.c b/bfd/vms-lib.c
index 4f7da81..d05fab7 100644
--- a/bfd/vms-lib.c
+++ b/bfd/vms-lib.c
@@ -557,6 +557,7 @@ vms_lib_bread_raw (struct bfd *abfd, void *buf, file_ptr nbytes)
if (!vms_lib_read_block (abfd))
return -1;
+ /* Do not read past the data block, do not read more than requested. */
l = DATA__LENGTH - vec->blk_off;
if (l > nbytes)
l = nbytes;
@@ -564,11 +565,13 @@ vms_lib_bread_raw (struct bfd *abfd, void *buf, file_ptr nbytes)
return 0;
if (buf != NULL)
{
+ /* Really read into BUF. */
if (bfd_bread (buf, l, abfd->my_archive) != l)
return -1;
}
else
{
+ /* Make as if we are reading. */
if (bfd_seek (abfd->my_archive, l, SEEK_CUR) != 0)
return -1;
}
@@ -818,6 +821,7 @@ vms_lib_bread (struct bfd *abfd, void *buf, file_ptr nbytes)
if (vec->rec_rem == 0)
{
+ /* End of record reached. */
if (bfd_libdata (abfd->my_archive)->kind == vms_lib_txt)
{
if ((vec->rec_len & 1) == 1