Lines Matching defs:objfile

158 /* Non-zero if there is any line number info in the objfile.  Prevents
190 objfile's text_addr and text_size members.
196 find_text_range (bfd * sym_bfd, struct objfile *objfile)
228 DBX_TEXT_ADDR (objfile) = start;
229 DBX_TEXT_SIZE (objfile) = end - start;
262 static void read_dbx_dynamic_symtab (struct objfile *objfile);
264 static void read_dbx_symtab (struct objfile *);
266 static void free_bincl_list (struct objfile *);
272 static void init_bincl_list (int, struct objfile *);
274 static char *dbx_next_symbol_text (struct objfile *);
278 static void dbx_symfile_init (struct objfile *);
280 static void dbx_new_init (struct objfile *);
282 static void dbx_symfile_read (struct objfile *, int);
284 static void dbx_symfile_finish (struct objfile *);
286 static void record_minimal_symbol (char *, CORE_ADDR, int, struct objfile *);
294 static struct partial_symtab *start_psymtab (struct objfile *, char *,
432 struct objfile *objfile)
442 section = SECT_OFF_TEXT (objfile);
443 bfd_section = DBX_TEXT_SECTION (objfile);
447 section = SECT_OFF_DATA (objfile);
448 bfd_section = DBX_DATA_SECTION (objfile);
452 section = SECT_OFF_BSS (objfile);
453 bfd_section = DBX_BSS_SECTION (objfile);
463 section = SECT_OFF_DATA (objfile);
464 bfd_section = DBX_DATA_SECTION (objfile);
471 section = SECT_OFF_DATA (objfile);
472 bfd_section = DBX_DATA_SECTION (objfile);
480 section = SECT_OFF_TEXT (objfile);
481 bfd_section = DBX_TEXT_SECTION (objfile);
496 if (tempstring[0] == bfd_get_symbol_leading_char (objfile->obfd))
501 section = SECT_OFF_DATA (objfile);
502 bfd_section = DBX_DATA_SECTION (objfile);
506 section = SECT_OFF_BSS (objfile);
507 bfd_section = DBX_BSS_SECTION (objfile);
521 (name, address, ms_type, NULL, section, bfd_section, objfile);
528 hung off the objfile structure.
534 dbx_symfile_read (struct objfile *objfile, int mainline)
540 sym_bfd = objfile->obfd;
560 val = bfd_seek (sym_bfd, DBX_SYMTAB_OFFSET (objfile), SEEK_SET);
562 perror_with_name (objfile->name);
566 || (objfile->global_psymbols.size == 0
567 && objfile->static_psymbols.size == 0))
568 init_psymbol_list (objfile, DBX_SYMCOUNT (objfile));
570 symbol_size = DBX_SYMBOL_SIZE (objfile);
571 symbol_table_offset = DBX_SYMTAB_OFFSET (objfile);
581 read_dbx_symtab (objfile);
585 read_dbx_dynamic_symtab (objfile);
588 minimal symbols for this objfile. */
590 install_minimal_symbols (objfile);
600 dbx_new_init (struct objfile *ignore)
610 It is passed a struct objfile which contains, among other things,
624 dbx_symfile_init (struct objfile *objfile)
627 bfd *sym_bfd = objfile->obfd;
633 objfile->sym_stab_info = (struct dbx_symfile_info *)
634 xmmalloc (objfile->md, sizeof (struct dbx_symfile_info));
635 memset (objfile->sym_stab_info, 0, sizeof (struct dbx_symfile_info));
637 DBX_TEXT_SECTION (objfile) = bfd_get_section_by_name (sym_bfd, ".text");
638 DBX_DATA_SECTION (objfile) = bfd_get_section_by_name (sym_bfd, ".data");
639 DBX_BSS_SECTION (objfile) = bfd_get_section_by_name (sym_bfd, ".bss");
647 DBX_SYMFILE_INFO (objfile)->stab_section_info = NULL;
652 DBX_TEXT_ADDR (objfile) = bfd_section_vma (sym_bfd, text_sect);
653 DBX_TEXT_SIZE (objfile) = bfd_section_size (sym_bfd, text_sect);
655 DBX_SYMBOL_SIZE (objfile) = obj_symbol_entry_size (sym_bfd);
656 DBX_SYMCOUNT (objfile) = bfd_get_symcount (sym_bfd);
657 DBX_SYMTAB_OFFSET (objfile) = SYMBOL_TABLE_OFFSET;
660 When we blow away the objfile the string table goes away as well.
677 DBX_STRINGTAB_SIZE (objfile) = 0;
678 DBX_STRINGTAB (objfile) = NULL;
697 DBX_STRINGTAB_SIZE (objfile) = 0;
698 DBX_STRINGTAB (objfile) = NULL;
709 DBX_STRINGTAB_SIZE (objfile) = bfd_h_get_32 (sym_bfd, size_temp);
711 if (DBX_STRINGTAB_SIZE (objfile) < sizeof (size_temp)
712 || DBX_STRINGTAB_SIZE (objfile) > bfd_get_size (sym_bfd))
714 DBX_STRINGTAB_SIZE (objfile));
716 DBX_STRINGTAB (objfile) =
717 (char *) obstack_alloc (&objfile->objfile_obstack,
718 DBX_STRINGTAB_SIZE (objfile));
719 OBJSTAT (objfile, sz_strtab += DBX_STRINGTAB_SIZE (objfile));
726 val = bfd_bread (DBX_STRINGTAB (objfile),
727 DBX_STRINGTAB_SIZE (objfile),
729 if (val != DBX_STRINGTAB_SIZE (objfile))
736 objfile. I.E, we are in the process of discarding all symbol information
737 for an objfile, freeing up all memory held for it, and unlinking the
738 objfile struct from the global list of known objfiles. */
741 dbx_symfile_finish (struct objfile *objfile)
743 if (objfile->sym_stab_info != NULL)
745 if (HEADER_FILES (objfile) != NULL)
747 int i = N_HEADER_FILES (objfile);
748 struct header_file *hfiles = HEADER_FILES (objfile);
757 xmfree (objfile->md, objfile->sym_stab_info);
878 dbx_next_symbol_text (struct objfile *objfile)
887 OBJSTAT (objfile, n_stabs++);
899 init_bincl_list (int number, struct objfile *objfile)
903 xmmalloc (objfile->md, bincls_allocated * sizeof (struct header_file_location));
916 xmrealloc (pst->objfile->md, (char *) bincl_list,
946 free_bincl_list (struct objfile *objfile)
948 xmfree (objfile->md, bincl_list);
953 do_free_bincl_list_cleanup (void *objfile)
955 free_bincl_list (objfile);
959 make_cleanup_free_bincl_list (struct objfile *objfile)
961 return make_cleanup (do_free_bincl_list_cleanup, objfile);
969 set_namestring (struct objfile *objfile, struct internal_nlist nlist)
974 DBX_STRINGTAB_SIZE (objfile))
982 DBX_STRINGTAB (objfile);
990 read_dbx_dynamic_symtab (struct objfile *objfile)
992 bfd *abfd = objfile->obfd;
1048 sym_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
1053 sym_value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
1058 sym_value += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS (objfile));
1068 type, objfile);
1099 rel->address + ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
1122 objfile);
1131 struct objfile *objfile)
1145 msym = lookup_minimal_symbol (p, filename, objfile);
1153 msym = lookup_minimal_symbol (p, filename, objfile);
1160 msym = lookup_minimal_symbol (p, NULL, objfile);
1167 msym = lookup_minimal_symbol (p, NULL, objfile);
1186 read_dbx_symtab (struct objfile *objfile)
1215 text_addr = DBX_TEXT_ADDR (objfile);
1216 text_size = DBX_TEXT_SIZE (objfile);
1223 stringtab_global = DBX_STRINGTAB (objfile);
1239 init_bincl_list (20, objfile);
1240 back_to = make_cleanup_free_bincl_list (objfile);
1246 symfile_bfd = objfile->obfd; /* For next_text_symbol */
1247 abfd = objfile->obfd;
1257 objfile->section_offsets we should apply to the variable's
1273 data_sect_index = objfile->sect_index_data;
1275 data_sect_index = SECT_OFF_BSS (objfile);
1277 data_sect_index = SECT_OFF_RODATA (objfile);
1285 for (symnum = 0; symnum < DBX_SYMCOUNT (objfile); symnum++)
1303 OBJSTAT (objfile, n_stabs++);
1326 nlist.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
1331 nlist.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
1338 nlist.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS (objfile));
1343 namestring = set_namestring (objfile, nlist);
1347 nlist.n_type, objfile); /* Always */
1362 nlist.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
1363 namestring = set_namestring (objfile, nlist);
1369 if (objfile->ei.entry_point < nlist.n_value &&
1370 objfile->ei.entry_point >= last_o_file_start)
1372 objfile->ei.deprecated_entry_file_lowpc = last_o_file_start;
1373 objfile->ei.deprecated_entry_file_highpc = nlist.n_value;
1398 nlist.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
1409 namestring = set_namestring (objfile, nlist);
1476 valu = nlist.n_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
1518 namestring = set_namestring (objfile, nlist);
1538 pst = start_psymtab (objfile,
1541 objfile->global_psymbols.next,
1542 objfile->static_psymbols.next);
1553 namestring = set_namestring (objfile, nlist);
1586 namestring = set_namestring (objfile, nlist);
1655 namestring = set_namestring (objfile, nlist);
1687 nlist.n_value += ANOFFSET (objfile->section_offsets, data_sect_index);
1693 &objfile->static_psymbols,
1695 psymtab_language, objfile);
1698 nlist.n_value += ANOFFSET (objfile->section_offsets, data_sect_index);
1703 &objfile->global_psymbols,
1705 psymtab_language, objfile);
1721 &objfile->static_psymbols,
1723 psymtab_language, objfile);
1729 &objfile->static_psymbols,
1731 psymtab_language, objfile);
1741 &objfile->static_psymbols,
1743 psymtab_language, objfile);
1793 p = next_symbol_text (objfile);
1803 &objfile->static_psymbols, 0,
1804 0, psymtab_language, objfile);
1820 &objfile->static_psymbols, nlist.n_value,
1821 0, psymtab_language, objfile);
1834 nlist.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
1840 if (nlist.n_value == ANOFFSET (objfile->section_offsets,
1841 SECT_OFF_TEXT (objfile)))
1844 find_stab_function_addr (namestring, pst->filename, objfile);
1873 != ANOFFSET (objfile->section_offsets,
1874 SECT_OFF_TEXT (objfile))))))
1881 &objfile->static_psymbols,
1883 psymtab_language, objfile);
1899 nlist.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
1905 if (nlist.n_value == ANOFFSET (objfile->section_offsets,
1906 SECT_OFF_TEXT (objfile)))
1909 find_stab_function_addr (namestring, pst->filename, objfile);
1938 != ANOFFSET (objfile->section_offsets,
1939 SECT_OFF_TEXT (objfile))))))
1946 &objfile->global_psymbols,
1948 psymtab_language, objfile);
1998 namestring = set_namestring (objfile, nlist);
2110 if (DBX_SYMCOUNT (objfile) > 0 /* We have some syms */
2113 && objfile->ei.entry_point < nlist.n_value
2114 && objfile->ei.entry_point >= last_o_file_start)
2116 objfile->ei.deprecated_entry_file_lowpc = last_o_file_start;
2117 objfile->ei.deprecated_entry_file_highpc = nlist.n_value;
2125 ? (text_addr + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)))
2147 start_psymtab (struct objfile *objfile, char *filename, CORE_ADDR textlow,
2152 start_psymtab_common (objfile, objfile->section_offsets,
2156 obstack_alloc (&objfile->objfile_obstack, sizeof (struct symloc));
2168 elfstab_offset_sections (objfile, result);
2188 struct objfile *objfile = pst->objfile;
2224 minsym = lookup_minimal_symbol (p, pst->filename, objfile);
2232 minsym = lookup_minimal_symbol (p, pst->filename, objfile);
2249 psymtabs for this objfile, and if any didn't know their ending text
2254 ALL_OBJFILE_PSYMTABS (objfile, p1)
2270 objfile->global_psymbols.next - (objfile->global_psymbols.list + pst->globals_offset);
2272 objfile->static_psymbols.next - (objfile->static_psymbols.list + pst->statics_offset);
2278 obstack_alloc (&objfile->objfile_obstack,
2289 allocate_psymtab (include_list[i], objfile);
2294 (char *) obstack_alloc (&objfile->objfile_obstack,
2304 obstack_alloc (&objfile->objfile_obstack,
2393 bfd_seek (pst->objfile->obfd, SYMBOL_OFFSET (pst), SEEK_SET);
2431 sym_bfd = pst->objfile->obfd;
2435 if (DBX_STAB_SECTION (pst->objfile))
2438 = symfile_relocate_debug_section (pst->objfile->obfd,
2439 DBX_STAB_SECTION (pst->objfile),
2452 scan_file_globals (pst->objfile);
2471 struct objfile *objfile;
2478 objfile = pst->objfile;
2483 /* This cannot be simply objfile->section_offsets because of
2486 objfile->section_offsets. */
2489 current_objfile = objfile;
2492 stringtab_global = DBX_STRINGTAB (objfile);
2495 abfd = objfile->obfd;
2496 symfile_bfd = objfile->obfd; /* Implicit param to next_text_symbol */
2513 OBJSTAT (objfile, n_stabs++);
2515 namestring = set_namestring (objfile, nlist);
2573 OBJSTAT (objfile, n_stabs++);
2577 namestring = set_namestring (objfile, nlist);
2582 namestring, section_offsets, objfile);
2639 pst->symtab = end_symtab (text_offset + text_size, objfile, SECT_OFF_TEXT (objfile));
2656 objfile->section_offsets but the pst->section_offsets.
2665 struct objfile *objfile)
2707 function_start_offset = ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
2750 objfile);
2763 valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
2872 new->start_addr, valu, objfile);
2893 valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
2902 valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
2929 end_symtab (valu, objfile, SECT_OFF_TEXT (objfile));
2952 valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
2993 common_block_start (name, objfile);
2997 common_block_end (objfile);
3038 valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
3058 valu += ANOFFSET (section_offsets, SECT_OFF_DATA (objfile));
3064 valu += ANOFFSET (section_offsets, SECT_OFF_BSS (objfile));
3068 valu += ANOFFSET (section_offsets, SECT_OFF_RODATA (objfile));
3073 valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
3125 && valu == ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile)))
3128 find_stab_function_addr (name, last_source_file, objfile);
3213 new->start_addr, valu, objfile);
3217 new->name = define_symbol (valu, name, desc, type, objfile);
3221 define_symbol (valu, name, desc, type, objfile);
3255 objfile it is in; If there is more than one N_MAIN, choose
3257 N_MAIN within a given objfile, complain() and choose
3331 coffstab_build_psymtabs (struct objfile *objfile, int mainline,
3337 bfd *sym_bfd = objfile->obfd;
3344 info = objfile->sym_stab_info;
3346 DBX_TEXT_ADDR (objfile) = textaddr;
3347 DBX_TEXT_SIZE (objfile) = textsize;
3350 DBX_SYMBOL_SIZE (objfile) = COFF_STABS_SYMBOL_SIZE;
3351 DBX_STRINGTAB_SIZE (objfile) = stabstrsize;
3355 DBX_STRINGTAB (objfile) = (char *)
3356 obstack_alloc (&objfile->objfile_obstack, stabstrsize + 1);
3357 OBJSTAT (objfile, sz_strtab += stabstrsize + 1);
3364 val = bfd_bread (DBX_STRINGTAB (objfile), stabstrsize, sym_bfd);
3381 DBX_SYMCOUNT (objfile) = stabsize / DBX_SYMBOL_SIZE (objfile);
3382 DBX_SYMTAB_OFFSET (objfile) = stabsects->section->filepos;
3388 DBX_SYMCOUNT (objfile) = 0;
3392 DBX_SYMCOUNT (objfile) += stabsize / DBX_SYMBOL_SIZE (objfile);
3395 DBX_SYMTAB_OFFSET (objfile) = stabsects->section->filepos;
3402 dbx_symfile_read (objfile, 0);
3426 elfstab_build_psymtabs (struct objfile *objfile, int mainline,
3431 bfd *sym_bfd = objfile->obfd;
3438 info = objfile->sym_stab_info;
3442 find_text_range (sym_bfd, objfile);
3445 DBX_SYMBOL_SIZE (objfile) = ELF_STABS_SYMBOL_SIZE;
3446 DBX_SYMCOUNT (objfile)
3447 = bfd_section_size (objfile->obfd, stabsect) / DBX_SYMBOL_SIZE (objfile);
3448 DBX_STRINGTAB_SIZE (objfile) = stabstrsize;
3449 DBX_SYMTAB_OFFSET (objfile) = stabsect->filepos;
3450 DBX_STAB_SECTION (objfile) = stabsect;
3454 DBX_STRINGTAB (objfile) = (char *)
3455 obstack_alloc (&objfile->objfile_obstack, stabstrsize + 1);
3456 OBJSTAT (objfile, sz_strtab += stabstrsize + 1);
3463 val = bfd_bread (DBX_STRINGTAB (objfile), stabstrsize, sym_bfd);
3475 symbuf_left = bfd_section_size (objfile->obfd, stabsect);
3476 stabs_data = symfile_relocate_debug_section (objfile->obfd, stabsect, NULL);
3486 dbx_symfile_read (objfile, 0);
3511 stabsect_build_psymtabs (struct objfile *objfile, int mainline, char *stab_name,
3515 bfd *sym_bfd = objfile->obfd;
3531 objfile->sym_stab_info = (struct dbx_symfile_info *)
3533 memset (objfile->sym_stab_info, 0, sizeof (struct dbx_symfile_info));
3538 DBX_TEXT_ADDR (objfile) = bfd_section_vma (sym_bfd, text_sect);
3539 DBX_TEXT_SIZE (objfile) = bfd_section_size (sym_bfd, text_sect);
3541 DBX_SYMBOL_SIZE (objfile) = sizeof (struct external_nlist);
3542 DBX_SYMCOUNT (objfile) = bfd_section_size (sym_bfd, stabsect)
3543 / DBX_SYMBOL_SIZE (objfile);
3544 DBX_STRINGTAB_SIZE (objfile) = bfd_section_size (sym_bfd, stabstrsect);
3545 DBX_SYMTAB_OFFSET (objfile) = stabsect->filepos; /* XXX - FIXME: POKING INSIDE BFD DATA STRUCTURES */
3547 if (DBX_STRINGTAB_SIZE (objfile) > bfd_get_size (sym_bfd))
3548 error ("ridiculous string table size: %d bytes", DBX_STRINGTAB_SIZE (objfile));
3549 DBX_STRINGTAB (objfile) = (char *)
3550 obstack_alloc (&objfile->objfile_obstack, DBX_STRINGTAB_SIZE (objfile) + 1);
3551 OBJSTAT (objfile, sz_strtab += DBX_STRINGTAB_SIZE (objfile) + 1);
3557 DBX_STRINGTAB (objfile), /* input buffer */
3559 DBX_STRINGTAB_SIZE (objfile)); /* amount to read */
3572 dbx_symfile_read (objfile, 0);