* elf.c (_bfd_elf_find_segment_containing_section): New function:
[deliverable/binutils-gdb.git] / bfd / elfxx-ia64.c
index 5aa1a0ab3910710f27eb767b78b4293844c3f7ea..535b1bc23b1ecb3ec1269ab24832328a12a6fb4f 100644 (file)
@@ -4894,24 +4894,11 @@ elfNN_ia64_relocate_section (bfd *output_bfd,
        case R_IA64_SEGREL64MSB:
        case R_IA64_SEGREL64LSB:
            {
-             struct elf_segment_map *m;
-             Elf_Internal_Phdr *p;
-
              /* Find the segment that contains the output_section.  */
-             for (m = elf_tdata (output_bfd)->segment_map,
-                    p = elf_tdata (output_bfd)->phdr;
-                  m != NULL;
-                  m = m->next, p++)
-               {
-                 int i;
-                 for (i = m->count - 1; i >= 0; i--)
-                   if (m->sections[i] == input_section->output_section)
-                     break;
-                 if (i >= 0)
-                   break;
-               }
+             Elf_Internal_Phdr *p = _bfd_elf_find_segment_containing_section
+               (input_bfd, input_section->output_section);
 
-             if (m == NULL)
+             if (p == NULL)
                {
                  r = bfd_reloc_notsupported;
                }
This page took 0.028375 seconds and 4 git commands to generate.