+ while (!feof (f) && fgets (buf, BUFSIZE - 1, f))
+ {
+ if (sscanf (buf, "%" STR_BUFSIZE "s %c %" STR_BUFSIZE "s", address, &type, name) != 3)
+ continue;
+ if (type != 't' && type != 'T')
+ continue;
+
+ sym_init (symtab.limit);
+
+ sscanf (address, "%" BFD_VMA_FMT "x", &(symtab.limit->addr) );
+
+ symtab.limit->name = (char *) xmalloc (strlen (name) + 1);
+ strcpy ((char *) symtab.limit->name, name);
+ symtab.limit->mapped = 0;
+ symtab.limit->is_func = TRUE;
+ symtab.limit->is_bb_head = TRUE;
+ symtab.limit->is_static = (type == 't');
+ min_vma = MIN (symtab.limit->addr, min_vma);
+ max_vma = MAX (symtab.limit->addr, max_vma);
+
+ ++symtab.limit;
+ }
+ fclose (f);
+
+ symtab.len = symtab.limit - symtab.base;
+ symtab_finalize (&symtab);
+}
+
+static int
+search_mapped_symbol (const void * l, const void * r)
+{
+ return strcmp ((const char *) l, ((const struct function_map *) r)->function_name);
+}
+
+/* Read in symbol table from core.
+ One symbol per function is entered. */
+
+void
+core_create_function_syms (void)
+{
+ bfd_vma min_vma = ~ (bfd_vma) 0;
+ bfd_vma max_vma = 0;
+ int cxxclass;
+ long i;
+ struct function_map * found = NULL;
+ int core_has_func_syms = 0;
+
+ switch (core_bfd->xvec->flavour)
+ {
+ default:
+ break;
+ case bfd_target_coff_flavour:
+ case bfd_target_ecoff_flavour:
+ case bfd_target_xcoff_flavour:
+ case bfd_target_elf_flavour:
+ case bfd_target_som_flavour:
+ core_has_func_syms = 1;
+ }
+
+ /* Pass 1 - determine upper bound on number of function names. */