Lines Matching refs:objfile
54 static void objfile_alloc_data (struct objfile *objfile);
55 static void objfile_free_data (struct objfile *objfile);
60 struct objfile *object_files; /* Linked list of all objfiles */
61 struct objfile *current_objfile; /* For symbol file being read in */
62 struct objfile *symfile_objfile; /* Main symbol table loaded from */
63 struct objfile *rt_common_objfile; /* For runtime common symbols */
82 struct objfile *objfile = (struct objfile *) objfile_p_char; in add_to_objfile_sections() local
94 section.objfile = objfile; in add_to_objfile_sections()
99 obstack_grow (&objfile->objfile_obstack, (char *) §ion, sizeof (section)); in add_to_objfile_sections()
100 objfile->sections_end = (struct obj_section *) (((unsigned long) objfile->sections_end) + 1); in add_to_objfile_sections()
120 build_objfile_section_table (struct objfile *objfile) in build_objfile_section_table() argument
128 objfile->sections_end = 0; in build_objfile_section_table()
129 bfd_map_over_sections (objfile->obfd, add_to_objfile_sections, (char *) objfile); in build_objfile_section_table()
130 objfile->sections = (struct obj_section *) in build_objfile_section_table()
131 obstack_finish (&objfile->objfile_obstack); in build_objfile_section_table()
132 objfile->sections_end = objfile->sections + (unsigned long) objfile->sections_end; in build_objfile_section_table()
154 struct objfile *
157 struct objfile *objfile = NULL; in allocate_objfile() local
158 struct objfile *last_one = NULL; in allocate_objfile()
164 if (objfile == NULL) in allocate_objfile()
166 objfile = (struct objfile *) xmalloc (sizeof (struct objfile)); in allocate_objfile()
167 memset (objfile, 0, sizeof (struct objfile)); in allocate_objfile()
168 objfile->md = NULL; in allocate_objfile()
169 objfile->psymbol_cache = bcache_xmalloc (); in allocate_objfile()
170 objfile->macro_cache = bcache_xmalloc (); in allocate_objfile()
173 obstack_init (&objfile->objfile_obstack); in allocate_objfile()
174 terminate_minimal_symbol_table (objfile); in allocate_objfile()
177 objfile_alloc_data (objfile); in allocate_objfile()
183 objfile->obfd = abfd; in allocate_objfile()
184 if (objfile->name != NULL) in allocate_objfile()
186 xfree (objfile->name); in allocate_objfile()
190 objfile->name = xstrdup (bfd_get_filename (abfd)); in allocate_objfile()
191 objfile->mtime = bfd_get_mtime (abfd); in allocate_objfile()
195 if (build_objfile_section_table (objfile)) in allocate_objfile()
198 objfile->name, bfd_errmsg (bfd_get_error ())); in allocate_objfile()
203 objfile->name = xstrdup ("<<anonymous objfile>>"); in allocate_objfile()
209 objfile->sect_index_text = -1; in allocate_objfile()
210 objfile->sect_index_data = -1; in allocate_objfile()
211 objfile->sect_index_bss = -1; in allocate_objfile()
212 objfile->sect_index_rodata = -1; in allocate_objfile()
216 objfile->cp_namespace_symtab = NULL; in allocate_objfile()
220 objfile->next = NULL; in allocate_objfile()
222 object_files = objfile; in allocate_objfile()
228 last_one->next = objfile; in allocate_objfile()
232 objfile->flags |= flags; in allocate_objfile()
234 return (objfile); in allocate_objfile()
240 init_entry_point_info (struct objfile *objfile) in init_entry_point_info() argument
245 if (bfd_get_file_flags (objfile->obfd) & EXEC_P) in init_entry_point_info()
249 objfile->ei.entry_point = bfd_get_start_address (objfile->obfd); in init_entry_point_info()
254 objfile->ei.entry_point = INVALID_ENTRY_POINT; in init_entry_point_info()
276 terminate_minimal_symbol_table (struct objfile *objfile) in terminate_minimal_symbol_table() argument
278 if (! objfile->msymbols) in terminate_minimal_symbol_table()
279 objfile->msymbols = ((struct minimal_symbol *) in terminate_minimal_symbol_table()
280 obstack_alloc (&objfile->objfile_obstack, in terminate_minimal_symbol_table()
281 sizeof (objfile->msymbols[0]))); in terminate_minimal_symbol_table()
285 = &objfile->msymbols[objfile->minimal_symbol_count]; in terminate_minimal_symbol_table()
299 put_objfile_before (struct objfile *objfile, struct objfile *before_this) in put_objfile_before() argument
301 struct objfile **objp; in put_objfile_before()
303 unlink_objfile (objfile); in put_objfile_before()
309 objfile->next = *objp; in put_objfile_before()
310 *objp = objfile; in put_objfile_before()
322 objfile_to_front (struct objfile *objfile) in objfile_to_front() argument
324 struct objfile **objp; in objfile_to_front()
327 if (*objp == objfile) in objfile_to_front()
330 *objp = objfile->next; in objfile_to_front()
332 objfile->next = object_files; in objfile_to_front()
333 object_files = objfile; in objfile_to_front()
353 unlink_objfile (struct objfile *objfile) in unlink_objfile() argument
355 struct objfile **objpp; in unlink_objfile()
359 if (*objpp == objfile) in unlink_objfile()
362 objfile->next = NULL; in unlink_objfile()
389 free_objfile (struct objfile *objfile) in free_objfile() argument
391 if (objfile->separate_debug_objfile) in free_objfile()
393 free_objfile (objfile->separate_debug_objfile); in free_objfile()
396 if (objfile->separate_debug_objfile_backlink) in free_objfile()
400 objfile->separate_debug_objfile_backlink->separate_debug_objfile = NULL; in free_objfile()
410 if (objfile->sf != NULL) in free_objfile()
412 (*objfile->sf->sym_finish) (objfile); in free_objfile()
417 if (objfile->obfd != NULL) in free_objfile()
419 char *name = bfd_get_filename (objfile->obfd); in free_objfile()
420 if (!bfd_close (objfile->obfd)) in free_objfile()
428 unlink_objfile (objfile); in free_objfile()
433 if (objfile == rt_common_objfile) in free_objfile()
449 objfile_free_data (objfile); in free_objfile()
450 if (objfile->name != NULL) in free_objfile()
452 xfree (objfile->name); in free_objfile()
454 if (objfile->global_psymbols.list) in free_objfile()
455 xfree (objfile->global_psymbols.list); in free_objfile()
456 if (objfile->static_psymbols.list) in free_objfile()
457 xfree (objfile->static_psymbols.list); in free_objfile()
459 bcache_xfree (objfile->psymbol_cache); in free_objfile()
460 bcache_xfree (objfile->macro_cache); in free_objfile()
461 if (objfile->demangled_names_hash) in free_objfile()
462 htab_delete (objfile->demangled_names_hash); in free_objfile()
463 obstack_free (&objfile->objfile_obstack, 0); in free_objfile()
464 xfree (objfile); in free_objfile()
465 objfile = NULL; in free_objfile()
475 make_cleanup_free_objfile (struct objfile *obj) in make_cleanup_free_objfile()
485 struct objfile *objfile, *temp; in free_all_objfiles() local
487 ALL_OBJFILES_SAFE (objfile, temp) in free_all_objfiles()
489 free_objfile (objfile); in free_all_objfiles()
497 objfile_relocate (struct objfile *objfile, struct section_offsets *new_offsets) in objfile_relocate() argument
501 alloca (SIZEOF_N_SECTION_OFFSETS (objfile->num_sections))); in objfile_relocate()
506 for (i = 0; i < objfile->num_sections; ++i) in objfile_relocate()
509 ANOFFSET (new_offsets, i) - ANOFFSET (objfile->section_offsets, i); in objfile_relocate()
521 ALL_OBJFILE_SYMTABS (objfile, s) in objfile_relocate()
552 fixup_symbol_section (sym, objfile); in objfile_relocate()
583 ALL_OBJFILE_PSYMTABS (objfile, p) in objfile_relocate()
585 p->textlow += ANOFFSET (delta, SECT_OFF_TEXT (objfile)); in objfile_relocate()
586 p->texthigh += ANOFFSET (delta, SECT_OFF_TEXT (objfile)); in objfile_relocate()
593 for (psym = objfile->global_psymbols.list; in objfile_relocate()
594 psym < objfile->global_psymbols.next; in objfile_relocate()
597 fixup_psymbol_section (*psym, objfile); in objfile_relocate()
602 for (psym = objfile->static_psymbols.list; in objfile_relocate()
603 psym < objfile->static_psymbols.next; in objfile_relocate()
606 fixup_psymbol_section (*psym, objfile); in objfile_relocate()
615 ALL_OBJFILE_MSYMBOLS (objfile, msym) in objfile_relocate()
621 msymbols_sort (objfile); in objfile_relocate()
625 for (i = 0; i < objfile->num_sections; ++i) in objfile_relocate()
626 (objfile->section_offsets)->offsets[i] = ANOFFSET (new_offsets, i); in objfile_relocate()
629 if (objfile->ei.entry_point != ~(CORE_ADDR) 0) in objfile_relocate()
634 s = find_pc_section (objfile->ei.entry_point); in objfile_relocate()
636 objfile->ei.entry_point += ANOFFSET (delta, s->the_bfd_section->index); in objfile_relocate()
638 objfile->ei.entry_point += ANOFFSET (delta, SECT_OFF_TEXT (objfile)); in objfile_relocate()
645 abfd = objfile->obfd; in objfile_relocate()
647 ALL_OBJFILE_OSECTIONS (objfile, s) in objfile_relocate()
667 struct objfile *ofp; in have_partial_symbols()
686 struct objfile *ofp; in have_full_symbols()
706 struct objfile *objf; in objfile_purge_solibs()
707 struct objfile *temp; in objfile_purge_solibs()
727 struct objfile *ofp; in have_minimal_symbols()
749 struct objfile *objfile; in find_pc_sect_section() local
751 ALL_OBJSECTIONS (objfile, s) in find_pc_sect_section()
791 is_in_import_list (char *name, struct objfile *objfile) in is_in_import_list() argument
795 if (!objfile || !name || !*name) in is_in_import_list()
798 for (i = 0; i < objfile->import_list_size; i++) in is_in_import_list()
799 if (objfile->import_list[i] && DEPRECATED_STREQ (name, objfile->import_list[i])) in is_in_import_list()
845 objfile_alloc_data (struct objfile *objfile) in objfile_alloc_data() argument
847 gdb_assert (objfile->data == NULL); in objfile_alloc_data()
848 objfile->num_data = objfile_data_registry.num_registrations; in objfile_alloc_data()
849 objfile->data = XCALLOC (objfile->num_data, void *); in objfile_alloc_data()
853 objfile_free_data (struct objfile *objfile) in objfile_free_data() argument
855 gdb_assert (objfile->data != NULL); in objfile_free_data()
856 xfree (objfile->data); in objfile_free_data()
857 objfile->data = NULL; in objfile_free_data()
861 clear_objfile_data (struct objfile *objfile) in clear_objfile_data() argument
863 gdb_assert (objfile->data != NULL); in clear_objfile_data()
864 memset (objfile->data, 0, objfile->num_data * sizeof (void *)); in clear_objfile_data()
868 set_objfile_data (struct objfile *objfile, const struct objfile_data *data, in set_objfile_data() argument
871 gdb_assert (data->index < objfile->num_data); in set_objfile_data()
872 objfile->data[data->index] = value; in set_objfile_data()
876 objfile_data (struct objfile *objfile, const struct objfile_data *data) in objfile_data() argument
878 gdb_assert (data->index < objfile->num_data); in objfile_data()
879 return objfile->data[data->index]; in objfile_data()