aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-bfin.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf32-bfin.c')
-rw-r--r--bfd/elf32-bfin.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/bfd/elf32-bfin.c b/bfd/elf32-bfin.c
index cff16b1..091e74e 100644
--- a/bfd/elf32-bfin.c
+++ b/bfd/elf32-bfin.c
@@ -1497,26 +1497,9 @@ _bfinfdpic_add_rofixup (bfd *output_bfd, asection *rofixup, bfd_vma offset,
static unsigned
_bfinfdpic_osec_to_segment (bfd *output_bfd, asection *osec)
{
- 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] == osec)
- break;
-
- if (i >= 0)
- break;
- }
+ Elf_Internal_Phdr *p = _bfd_elf_find_segment_containing_section (output_bfd, osec);
- return p - elf_tdata (output_bfd)->phdr;
+ return (p != NULL) ? p - elf_tdata (output_bfd)->phdr : -1;
}
inline static bfd_boolean