diff options
author | Tristan Gingold <gingold@adacore.com> | 2012-02-10 10:09:14 +0000 |
---|---|---|
committer | Tristan Gingold <gingold@adacore.com> | 2012-02-10 10:09:14 +0000 |
commit | 3316705c1e939076ce9893575e8648ce5c93e838 (patch) | |
tree | fb1e74c37fd0cfa139e0483aae28227b3ac3936a /bfd | |
parent | 2705adc1b63c6cc992b80851c062c91fd47c18e2 (diff) | |
download | binutils-redhat-3316705c1e939076ce9893575e8648ce5c93e838.tar.gz |
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')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elfnn-ia64.c | 19 |
2 files changed, 19 insertions, 5 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index d85c9f52a5..c6e315988a 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2012-02-10 Tristan Gingold <gingold@adacore.com> + + * elfnn-ia64.c (elfNN_vms_object_p): Change comparison operator + to avoid infinite loop. Add comments. + 2012-02-09 H.J. Lu <hongjiu.lu@intel.com> PR ld/13675 diff --git a/bfd/elfnn-ia64.c b/bfd/elfnn-ia64.c index 3e2ee0b030..d70b28e9d3 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. */ |