+
+ cache_ptr = lineno_cache;
+ src = native_lineno;
+ nbr_func = 0;
+
+ for (counter = 0; counter < asect->lineno_count; counter++)
+ {
+ struct internal_lineno dst;
+
+ bfd_coff_swap_lineno_in (abfd, src, &dst);
+ cache_ptr->line_number = dst.l_lnno;
+
+ if (cache_ptr->line_number == 0)
+ {
+ bfd_boolean warned;
+ bfd_signed_vma symndx;
+ coff_symbol_type *sym;
+
+ nbr_func++;
+ warned = FALSE;
+ symndx = dst.l_addr.l_symndx;
+ if (symndx < 0
+ || (bfd_vma) symndx >= obj_raw_syment_count (abfd))
+ {
+ (*_bfd_error_handler)
+ (_("%B: warning: illegal symbol index %ld in line numbers"),
+ abfd, dst.l_addr.l_symndx);
+ symndx = 0;
+ warned = TRUE;
+ }
+
+ /* FIXME: We should not be casting between ints and
+ pointers like this. */
+ sym = ((coff_symbol_type *)
+ ((symndx + obj_raw_syments (abfd))
+ ->u.syment._n._n_n._n_zeroes));
+ cache_ptr->u.sym = (asymbol *) sym;
+ if (sym->lineno != NULL && ! warned)
+ (*_bfd_error_handler)
+ (_("%B: warning: duplicate line number information for `%s'"),
+ abfd, bfd_asymbol_name (&sym->symbol));
+
+ sym->lineno = cache_ptr;
+ if (sym->symbol.value < prev_offset)
+ ordered = 0;
+ prev_offset = sym->symbol.value;
+ }
+ else
+ cache_ptr->u.offset = dst.l_addr.l_paddr
+ - bfd_section_vma (abfd, asect);
+
+ cache_ptr++;
+ src++;
+ }
+ cache_ptr->line_number = 0;
+
+ /* On some systems (eg AIX5.3) the lineno table may not be sorted. */
+ if (!ordered)