aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-ia64.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-07-19 01:10:28 +0000
committerAlan Modra <amodra@gmail.com>2002-07-19 01:10:28 +0000
commit40c97fc6d18713f6c97d16539555f6d6ab825c1e (patch)
treed22521a0ef733164187346360c7532f1d1d1d8ec /bfd/elfxx-ia64.c
parent0f815cdf7e77a23380ae4a1ff43b2d24117bf3f2 (diff)
downloadgdb-40c97fc6d18713f6c97d16539555f6d6ab825c1e.zip
gdb-40c97fc6d18713f6c97d16539555f6d6ab825c1e.tar.gz
gdb-40c97fc6d18713f6c97d16539555f6d6ab825c1e.tar.bz2
* elfxx-ia64.c: (elfNN_ia64_modify_segment_map): Properly scan
PT_IA_64_UNWIND segments for a given section.
Diffstat (limited to 'bfd/elfxx-ia64.c')
-rw-r--r--bfd/elfxx-ia64.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c
index 108cdf0..b63cfb0 100644
--- a/bfd/elfxx-ia64.c
+++ b/bfd/elfxx-ia64.c
@@ -1369,8 +1369,6 @@ elfNN_ia64_modify_segment_map (abfd)
struct elf_segment_map *m, **pm;
Elf_Internal_Shdr *hdr;
asection *s;
- boolean unwind_found;
- asection *unwind_sec;
/* If we need a PT_IA_64_ARCHEXT segment, it must come before
all PT_LOAD segments. */
@@ -1415,20 +1413,16 @@ elfNN_ia64_modify_segment_map (abfd)
for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next)
if (m->p_type == PT_IA_64_UNWIND)
{
+ int i;
+
/* Look through all sections in the unwind segment
for a match since there may be multiple sections
to a segment. */
+ for (i = m->count - 1; i >= 0; --i)
+ if (m->sections[i] == s)
+ break;
- unwind_sec = m->sections[0];
- unwind_found = false;
- while (unwind_sec != NULL && !unwind_found)
- {
- if (unwind_sec == s)
- unwind_found = true;
- else
- unwind_sec = unwind_sec -> next;
- }
- if (unwind_found)
+ if (i >= 0)
break;
}