aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfnn-ia64.c
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2012-02-10 10:09:14 +0000
committerTristan Gingold <gingold@adacore.com>2012-02-10 10:09:14 +0000
commit565a6476ffc155689d6ac16185a2208ca586078a (patch)
tree43136062f974f2eebf8bae165db48b4ab5ba5a63 /bfd/elfnn-ia64.c
parent035d1e5be62ba280ba325ab669163205a98d17c4 (diff)
downloadgdb-565a6476ffc155689d6ac16185a2208ca586078a.zip
gdb-565a6476ffc155689d6ac16185a2208ca586078a.tar.gz
gdb-565a6476ffc155689d6ac16185a2208ca586078a.tar.bz2
2012-02-10 Tristan Gingold <gingold@adacore.com>
* elfnn-ia64.c (elfNN_vms_object_p): Change comparison operator to avoid infinite loop. Add comments.
Diffstat (limited to 'bfd/elfnn-ia64.c')
-rw-r--r--bfd/elfnn-ia64.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/bfd/elfnn-ia64.c b/bfd/elfnn-ia64.c
index 3e2ee0b..d70b28e 100644
--- a/bfd/elfnn-ia64.c
+++ b/bfd/elfnn-ia64.c
@@ -5036,18 +5036,27 @@ elfNN_vms_object_p (bfd *abfd)
flagword flags;
char *nname = NULL;
- /* Find a section covering base_vma. */
+ /* Find a section covering [base_vma;limit_vma) */
for (sec = abfd->sections; sec != NULL; sec = sec->next)
{
- if ((sec->flags & (SEC_ALLOC | SEC_LOAD)) == 0)
+ /* Skip uninteresting sections (either not in memory or
+ below base_vma. */
+ if ((sec->flags & (SEC_ALLOC | SEC_LOAD)) == 0
+ || sec->vma + sec->size <= base_vma)
continue;
- if (sec->vma <= base_vma && sec->vma + sec->size > base_vma)
+ if (sec->vma <= base_vma)
{
+ /* This section covers (maybe partially) the beginning
+ of the range. */
base_vma = sec->vma + sec->size;
goto again;
}
- if (sec->vma < next_vma && sec->vma + sec->size >= base_vma)
- next_vma = sec->vma;
+ if (sec->vma < next_vma)
+ {
+ /* This section partially covers the end of the range.
+ Used to compute the size of the hole. */
+ next_vma = sec->vma;
+ }
}
/* No section covering [base_vma; next_vma). Create a fake one. */