+ i = 0;
+ while (1)
+ {
+ combined_entry_type *p2;
+
+ /* Avoid endless loops on erroneous files by ensuring that
+ we always move forward in the file. */
+ if (i >= p->u.syment.n_value)
+ break;
+
+ i = p->u.syment.n_value;
+ if (i >= cof->raw_syment_count)
+ break;
+
+ p = cof->raw_syments + i;
+ if (p->u.syment.n_sclass != C_FILE)
+ break;
+
+ for (p2 = p; p2 < pend; p2 += 1 + p2->u.syment.n_numaux)
+ {
+ if (section ==
+ coff_section_from_bfd_index (abfd, p2->u.syment.n_scnum))
+ break;
+ }
+ if (p2 < pend
+ && offset < p2->u.syment.n_value)
+ break;
+
+ *filename_ptr = (char *) p->u.syment._n._n_n._n_offset;
+ }