Lines Matching refs:objfile
72 void (*deprecated_target_new_objfile_hook) (struct objfile *);
100 static void reread_separate_symbols (struct objfile *objfile);
106 int get_section_index (struct objfile *, char *);
108 static void find_sym_fns (struct objfile *);
146 static char *find_separate_debug_file (struct objfile *objfile);
208 qsort (pst->objfile->global_psymbols.list + pst->globals_offset, in sort_pst_symbols()
401 init_objfile_sect_indices (struct objfile *objfile) in init_objfile_sect_indices() argument
406 sect = bfd_get_section_by_name (objfile->obfd, ".text"); in init_objfile_sect_indices()
408 objfile->sect_index_text = sect->index; in init_objfile_sect_indices()
410 sect = bfd_get_section_by_name (objfile->obfd, ".data"); in init_objfile_sect_indices()
412 objfile->sect_index_data = sect->index; in init_objfile_sect_indices()
414 sect = bfd_get_section_by_name (objfile->obfd, ".bss"); in init_objfile_sect_indices()
416 objfile->sect_index_bss = sect->index; in init_objfile_sect_indices()
418 sect = bfd_get_section_by_name (objfile->obfd, ".rodata"); in init_objfile_sect_indices()
420 objfile->sect_index_rodata = sect->index; in init_objfile_sect_indices()
432 for (i = 0; i < objfile->num_sections; i++) in init_objfile_sect_indices()
434 if (ANOFFSET (objfile->section_offsets, i) != 0) in init_objfile_sect_indices()
439 if (i == objfile->num_sections) in init_objfile_sect_indices()
441 if (objfile->sect_index_text == -1) in init_objfile_sect_indices()
442 objfile->sect_index_text = 0; in init_objfile_sect_indices()
443 if (objfile->sect_index_data == -1) in init_objfile_sect_indices()
444 objfile->sect_index_data = 0; in init_objfile_sect_indices()
445 if (objfile->sect_index_bss == -1) in init_objfile_sect_indices()
446 objfile->sect_index_bss = 0; in init_objfile_sect_indices()
447 if (objfile->sect_index_rodata == -1) in init_objfile_sect_indices()
448 objfile->sect_index_rodata = 0; in init_objfile_sect_indices()
460 default_symfile_offsets (struct objfile *objfile, in default_symfile_offsets() argument
465 objfile->num_sections = bfd_count_sections (objfile->obfd); in default_symfile_offsets()
466 objfile->section_offsets = (struct section_offsets *) in default_symfile_offsets()
467 obstack_alloc (&objfile->objfile_obstack, in default_symfile_offsets()
468 SIZEOF_N_SECTION_OFFSETS (objfile->num_sections)); in default_symfile_offsets()
469 memset (objfile->section_offsets, 0, in default_symfile_offsets()
470 SIZEOF_N_SECTION_OFFSETS (objfile->num_sections)); in default_symfile_offsets()
485 (objfile->section_offsets)->offsets[osp->sectindex] = osp->addr; in default_symfile_offsets()
490 init_objfile_sect_indices (objfile); in default_symfile_offsets()
527 syms_from_objfile (struct objfile *objfile, in syms_from_objfile() argument
539 init_entry_point_info (objfile); in syms_from_objfile()
540 find_sym_fns (objfile); in syms_from_objfile()
542 if (objfile->sf == NULL) in syms_from_objfile()
547 old_chain = make_cleanup_free_objfile (objfile); in syms_from_objfile()
555 = alloc_section_addr_info (bfd_count_sections (objfile->obfd)); in syms_from_objfile()
581 (*objfile->sf->sym_new_init) (objfile); in syms_from_objfile()
600 lower_sect = bfd_get_section_by_name (objfile->obfd, ".text"); in syms_from_objfile()
602 bfd_map_over_sections (objfile->obfd, find_lowest_section, in syms_from_objfile()
606 objfile->name); in syms_from_objfile()
608 if ((bfd_get_section_flags (objfile->obfd, lower_sect) & SEC_CODE) == 0) in syms_from_objfile()
610 objfile->name, in syms_from_objfile()
611 bfd_section_name (objfile->obfd, lower_sect), in syms_from_objfile()
612 paddr (bfd_section_vma (objfile->obfd, lower_sect))); in syms_from_objfile()
614 lower_offset = bfd_section_vma (objfile->obfd, lower_sect); in syms_from_objfile()
632 sect = bfd_get_section_by_name (objfile->obfd, in syms_from_objfile()
637 -= bfd_section_vma (objfile->obfd, sect); in syms_from_objfile()
646 objfile->name); in syms_from_objfile()
659 (*objfile->sf->sym_init) (objfile); in syms_from_objfile()
663 (*objfile->sf->sym_offsets) (objfile, addrs); in syms_from_objfile()
669 objfile->num_sections = num_offsets; in syms_from_objfile()
670 objfile->section_offsets in syms_from_objfile()
672 obstack_alloc (&objfile->objfile_obstack, size)); in syms_from_objfile()
673 memcpy (objfile->section_offsets, offsets, size); in syms_from_objfile()
675 init_objfile_sect_indices (objfile); in syms_from_objfile()
706 ALL_OBJFILE_OSECTIONS (objfile, s) in syms_from_objfile()
714 if (strcmp (bfd_section_name (s->objfile->obfd, in syms_from_objfile()
728 (*objfile->sf->sym_read) (objfile, mainline); in syms_from_objfile()
741 objfile->flags |= OBJF_SYMS; in syms_from_objfile()
753 new_symfile_objfile (struct objfile *objfile, int mainline, int verbo) in new_symfile_objfile() argument
762 symfile_objfile = objfile; in new_symfile_objfile()
792 static struct objfile *
799 struct objfile *objfile; in symbol_file_add_with_addrs_or_offsets() local
817 objfile = allocate_objfile (abfd, flags); in symbol_file_add_with_addrs_or_offsets()
840 syms_from_objfile (objfile, addrs, offsets, num_offsets, in symbol_file_add_with_addrs_or_offsets()
857 for (psymtab = objfile->psymtabs; in symbol_file_add_with_addrs_or_offsets()
865 debugfile = find_separate_debug_file (objfile); in symbol_file_add_with_addrs_or_offsets()
870 objfile->separate_debug_objfile in symbol_file_add_with_addrs_or_offsets()
875 objfile->separate_debug_objfile in symbol_file_add_with_addrs_or_offsets()
878 objfile->separate_debug_objfile->separate_debug_objfile_backlink in symbol_file_add_with_addrs_or_offsets()
879 = objfile; in symbol_file_add_with_addrs_or_offsets()
883 put_objfile_before (objfile->separate_debug_objfile, objfile); in symbol_file_add_with_addrs_or_offsets()
916 if (objfile->sf == NULL) in symbol_file_add_with_addrs_or_offsets()
917 return objfile; /* No symbols. */ in symbol_file_add_with_addrs_or_offsets()
919 new_symfile_objfile (objfile, mainline, from_tty); in symbol_file_add_with_addrs_or_offsets()
922 deprecated_target_new_objfile_hook (objfile); in symbol_file_add_with_addrs_or_offsets()
925 return (objfile); in symbol_file_add_with_addrs_or_offsets()
934 struct objfile *
948 struct objfile *
1011 get_debug_link_info (struct objfile *objfile, unsigned long *crc32_out) in get_debug_link_info() argument
1020 sect = bfd_get_section_by_name (objfile->obfd, ".gnu_debuglink"); in get_debug_link_info()
1025 debuglink_size = bfd_section_size (objfile->obfd, sect); in get_debug_link_info()
1028 bfd_get_section_contents (objfile->obfd, sect, contents, in get_debug_link_info()
1035 crc32 = bfd_get_32 (objfile->obfd, (bfd_byte *) (contents + crc_offset)); in get_debug_link_info()
1068 find_separate_debug_file (struct objfile *objfile) in find_separate_debug_file() argument
1079 basename = get_debug_link_info (objfile, &crc32); in find_separate_debug_file()
1084 dir = xstrdup (objfile->name); in find_separate_debug_file()
1302 get_section_index (struct objfile *objfile, char *section_name) in get_section_index() argument
1304 asection *sect = bfd_get_section_by_name (objfile->obfd, section_name); in get_section_index()
1330 find_sym_fns (struct objfile *objfile) in find_sym_fns() argument
1333 enum bfd_flavour our_flavour = bfd_get_flavour (objfile->obfd); in find_sym_fns()
1334 char *our_target = bfd_get_target (objfile->obfd); in find_sym_fns()
1345 objfile->sf = sf; in find_sym_fns()
1350 bfd_get_target (objfile->obfd)); in find_sym_fns()
1804 struct objfile *objfile; in reread_symbols() local
1816 for (objfile = object_files; objfile; objfile = objfile->next) in reread_symbols()
1818 if (objfile->obfd) in reread_symbols()
1824 if (objfile->obfd->my_archive) in reread_symbols()
1825 res = stat (objfile->obfd->my_archive->filename, &new_statbuf); in reread_symbols()
1828 res = stat (objfile->name, &new_statbuf); in reread_symbols()
1833 objfile->name); in reread_symbols()
1837 if (new_modtime != objfile->mtime) in reread_symbols()
1845 objfile->name); in reread_symbols()
1857 old_cleanups = make_cleanup_free_objfile (objfile); in reread_symbols()
1864 obfd_filename = bfd_get_filename (objfile->obfd); in reread_symbols()
1865 if (!bfd_close (objfile->obfd)) in reread_symbols()
1866 error ("Can't close BFD for %s: %s", objfile->name, in reread_symbols()
1868 objfile->obfd = bfd_openr (obfd_filename, gnutarget); in reread_symbols()
1869 if (objfile->obfd == NULL) in reread_symbols()
1870 error ("Can't open %s to read symbols.", objfile->name); in reread_symbols()
1872 if (!bfd_check_format (objfile->obfd, bfd_object)) in reread_symbols()
1873 error ("Can't read symbols from %s: %s.", objfile->name, in reread_symbols()
1878 num_offsets = objfile->num_sections; in reread_symbols()
1881 memcpy (offsets, objfile->section_offsets, in reread_symbols()
1890 if (objfile->global_psymbols.list) in reread_symbols()
1891 xfree (objfile->global_psymbols.list); in reread_symbols()
1892 memset (&objfile->global_psymbols, 0, in reread_symbols()
1893 sizeof (objfile->global_psymbols)); in reread_symbols()
1894 if (objfile->static_psymbols.list) in reread_symbols()
1895 xfree (objfile->static_psymbols.list); in reread_symbols()
1896 memset (&objfile->static_psymbols, 0, in reread_symbols()
1897 sizeof (objfile->static_psymbols)); in reread_symbols()
1900 bcache_xfree (objfile->psymbol_cache); in reread_symbols()
1901 objfile->psymbol_cache = bcache_xmalloc (); in reread_symbols()
1902 bcache_xfree (objfile->macro_cache); in reread_symbols()
1903 objfile->macro_cache = bcache_xmalloc (); in reread_symbols()
1904 if (objfile->demangled_names_hash != NULL) in reread_symbols()
1906 htab_delete (objfile->demangled_names_hash); in reread_symbols()
1907 objfile->demangled_names_hash = NULL; in reread_symbols()
1909 obstack_free (&objfile->objfile_obstack, 0); in reread_symbols()
1910 objfile->sections = NULL; in reread_symbols()
1911 objfile->symtabs = NULL; in reread_symbols()
1912 objfile->psymtabs = NULL; in reread_symbols()
1913 objfile->free_psymtabs = NULL; in reread_symbols()
1914 objfile->cp_namespace_symtab = NULL; in reread_symbols()
1915 objfile->msymbols = NULL; in reread_symbols()
1916 objfile->sym_private = NULL; in reread_symbols()
1917 objfile->minimal_symbol_count = 0; in reread_symbols()
1918 memset (&objfile->msymbol_hash, 0, in reread_symbols()
1919 sizeof (objfile->msymbol_hash)); in reread_symbols()
1920 memset (&objfile->msymbol_demangled_hash, 0, in reread_symbols()
1921 sizeof (objfile->msymbol_demangled_hash)); in reread_symbols()
1922 objfile->fundamental_types = NULL; in reread_symbols()
1923 clear_objfile_data (objfile); in reread_symbols()
1924 if (objfile->sf != NULL) in reread_symbols()
1926 (*objfile->sf->sym_finish) (objfile); in reread_symbols()
1930 objfile->md = NULL; in reread_symbols()
1931 objfile->psymbol_cache = bcache_xmalloc (); in reread_symbols()
1932 objfile->macro_cache = bcache_xmalloc (); in reread_symbols()
1937 obstack_init (&objfile->objfile_obstack); in reread_symbols()
1938 if (build_objfile_section_table (objfile)) in reread_symbols()
1941 objfile->name, bfd_errmsg (bfd_get_error ())); in reread_symbols()
1943 terminate_minimal_symbol_table (objfile); in reread_symbols()
1947 objfile->section_offsets = (struct section_offsets *) in reread_symbols()
1948 obstack_alloc (&objfile->objfile_obstack, in reread_symbols()
1950 memcpy (objfile->section_offsets, offsets, in reread_symbols()
1952 objfile->num_sections = num_offsets; in reread_symbols()
1957 if (objfile == symfile_objfile) in reread_symbols()
1959 (*objfile->sf->sym_new_init) (objfile); in reread_symbols()
1962 (*objfile->sf->sym_init) (objfile); in reread_symbols()
1967 (*objfile->sf->sym_read) (objfile, 0); in reread_symbols()
1974 objfile->flags |= OBJF_SYMS; in reread_symbols()
1987 init_entry_point_info (objfile); in reread_symbols()
1992 objfile->mtime = new_modtime; in reread_symbols()
1994 reread_separate_symbols (objfile); in reread_symbols()
2017 reread_separate_symbols (struct objfile *objfile) in reread_separate_symbols() argument
2024 debug_file = find_separate_debug_file (objfile); in reread_separate_symbols()
2026 if (objfile->separate_debug_objfile) in reread_separate_symbols()
2042 || strcmp (debug_file, objfile->separate_debug_objfile->name) != 0) in reread_separate_symbols()
2043 free_objfile (objfile->separate_debug_objfile); in reread_separate_symbols()
2049 && ! objfile->separate_debug_objfile) in reread_separate_symbols()
2053 objfile->separate_debug_objfile in reread_separate_symbols()
2058 objfile->section_offsets, objfile->num_sections, in reread_separate_symbols()
2060 objfile->flags & (OBJF_REORDERED | OBJF_SHARED | OBJF_READNOW in reread_separate_symbols()
2062 objfile->separate_debug_objfile->separate_debug_objfile_backlink in reread_separate_symbols()
2063 = objfile; in reread_separate_symbols()
2232 allocate_symtab (char *filename, struct objfile *objfile) in allocate_symtab() argument
2237 obstack_alloc (&objfile->objfile_obstack, sizeof (struct symtab)); in allocate_symtab()
2240 &objfile->objfile_obstack); in allocate_symtab()
2244 &objfile->objfile_obstack); in allocate_symtab()
2248 symtab->objfile = objfile; in allocate_symtab()
2249 symtab->next = objfile->symtabs; in allocate_symtab()
2250 objfile->symtabs = symtab; in allocate_symtab()
2264 allocate_psymtab (char *filename, struct objfile *objfile) in allocate_psymtab() argument
2268 if (objfile->free_psymtabs) in allocate_psymtab()
2270 psymtab = objfile->free_psymtabs; in allocate_psymtab()
2271 objfile->free_psymtabs = psymtab->next; in allocate_psymtab()
2275 obstack_alloc (&objfile->objfile_obstack, in allocate_psymtab()
2280 &objfile->objfile_obstack); in allocate_psymtab()
2287 psymtab->objfile = objfile; in allocate_psymtab()
2288 psymtab->next = objfile->psymtabs; in allocate_psymtab()
2289 objfile->psymtabs = psymtab; in allocate_psymtab()
2293 psymtab->objfile = objfile; in allocate_psymtab()
2295 prev_pst = &(objfile->psymtabs); in allocate_psymtab()
2319 prev_pst = &(pst->objfile->psymtabs); in discard_psymtab()
2326 pst->next = pst->objfile->free_psymtabs; in discard_psymtab()
2327 pst->objfile->free_psymtabs = pst; in discard_psymtab()
2411 for (ps = pst->objfile->psymtabs; ps; ps = ps->next) in cashier_psymtab()
2421 if (ps == pst->objfile->psymtabs) in cashier_psymtab()
2422 pst->objfile->psymtabs = ps->next; in cashier_psymtab()
2434 for (ps = pst->objfile->psymtabs; ps; ps = ps->next) in cashier_psymtab()
2569 start_psymtab_common (struct objfile *objfile, in start_psymtab_common() argument
2576 psymtab = allocate_psymtab (filename, objfile); in start_psymtab_common()
2580 psymtab->globals_offset = global_syms - objfile->global_psymbols.list; in start_psymtab_common()
2581 psymtab->statics_offset = static_syms - objfile->static_psymbols.list; in start_psymtab_common()
2605 enum language language, struct objfile *objfile) in add_psymbol_to_list() argument
2631 SYMBOL_SET_NAMES (&psymbol, buf, namelength, objfile); in add_psymbol_to_list()
2635 objfile->psymbol_cache); in add_psymbol_to_list()
2640 extend_psymbol_list (list, objfile); in add_psymbol_to_list()
2643 OBJSTAT (objfile, n_psyms++); in add_psymbol_to_list()
2659 struct objfile *objfile) in add_psymbol_with_dem_name_to_list() argument
2673 objfile->psymbol_cache); in add_psymbol_with_dem_name_to_list()
2684 deprecated_bcache (buf, dem_namelength + 1, objfile->psymbol_cache); in add_psymbol_with_dem_name_to_list()
2706 objfile->psymbol_cache); in add_psymbol_with_dem_name_to_list()
2711 extend_psymbol_list (list, objfile); in add_psymbol_with_dem_name_to_list()
2714 OBJSTAT (objfile, n_psyms++); in add_psymbol_with_dem_name_to_list()
2720 init_psymbol_list (struct objfile *objfile, int total_symbols) in init_psymbol_list() argument
2724 if (objfile->global_psymbols.list) in init_psymbol_list()
2726 xfree (objfile->global_psymbols.list); in init_psymbol_list()
2728 if (objfile->static_psymbols.list) in init_psymbol_list()
2730 xfree (objfile->static_psymbols.list); in init_psymbol_list()
2737 objfile->global_psymbols.size = total_symbols / 10; in init_psymbol_list()
2738 objfile->static_psymbols.size = total_symbols / 10; in init_psymbol_list()
2740 if (objfile->global_psymbols.size > 0) in init_psymbol_list()
2742 objfile->global_psymbols.next = in init_psymbol_list()
2743 objfile->global_psymbols.list = (struct partial_symbol **) in init_psymbol_list()
2744 xmalloc ((objfile->global_psymbols.size in init_psymbol_list()
2747 if (objfile->static_psymbols.size > 0) in init_psymbol_list()
2749 objfile->static_psymbols.next = in init_psymbol_list()
2750 objfile->static_psymbols.list = (struct partial_symbol **) in init_psymbol_list()
2751 xmalloc ((objfile->static_psymbols.size in init_psymbol_list()
2837 struct objfile *objfile; in overlay_invalidate_all() local
2840 ALL_OBJSECTIONS (objfile, sect) in overlay_invalidate_all()
2891 struct objfile *objfile; in section_is_mapped() local
2896 ALL_OBJSECTIONS (objfile, osect) in section_is_mapped()
3030 struct objfile *objfile; in find_pc_overlay() local
3034 ALL_OBJSECTIONS (objfile, osect) in find_pc_overlay()
3057 struct objfile *objfile; in find_pc_mapped_section() local
3061 ALL_OBJSECTIONS (objfile, osect) in find_pc_mapped_section()
3076 struct objfile *objfile; in list_overlays_command() local
3080 ALL_OBJSECTIONS (objfile, osect) in list_overlays_command()
3087 vma = bfd_section_vma (objfile->obfd, osect->the_bfd_section); in list_overlays_command()
3088 lma = bfd_section_lma (objfile->obfd, osect->the_bfd_section); in list_overlays_command()
3090 name = bfd_section_name (objfile->obfd, osect->the_bfd_section); in list_overlays_command()
3114 struct objfile *objfile, *objfile2; in map_overlay_command() local
3127 ALL_OBJSECTIONS (objfile, sec) in map_overlay_command()
3128 if (!strcmp (bfd_section_name (objfile->obfd, sec->the_bfd_section), args)) in map_overlay_command()
3149 bfd_section_name (objfile->obfd, in map_overlay_command()
3165 struct objfile *objfile; in unmap_overlay_command() local
3177 ALL_OBJSECTIONS (objfile, sec) in unmap_overlay_command()
3178 if (!strcmp (bfd_section_name (objfile->obfd, sec->the_bfd_section), args)) in unmap_overlay_command()
3426 bfd *obfd = osect->objfile->obfd; in simple_overlay_update_1()
3461 struct objfile *objfile; in simple_overlay_update() local
3483 ALL_OBJSECTIONS (objfile, osect) in simple_overlay_update()
3487 bfd *obfd = osect->objfile->obfd; in simple_overlay_update()