obstack_init (&storage->storage_obstack);
storage->filename_cache = bcache_xmalloc (NULL, NULL);
storage->macro_cache = bcache_xmalloc (NULL, NULL);
+ storage->language_of_main = language_unknown;
}
return storage;
objfile->per_bfd = get_objfile_bfd_data (objfile, objfile->obfd);
}
+/* Set the objfile's per-BFD notion of the "main" name and
+ language. */
+
+void
+set_objfile_main_name (struct objfile *objfile,
+ const char *name, enum language lang)
+{
+ if (objfile->per_bfd->name_of_main == NULL
+ || strcmp (objfile->per_bfd->name_of_main, name) != 0)
+ objfile->per_bfd->name_of_main
+ = obstack_copy0 (&objfile->per_bfd->storage_obstack, name, strlen (name));
+ objfile->per_bfd->language_of_main = lang;
+}
+
\f
/* Called via bfd_map_over_sections to build up the section table that
int
entry_point_address_query (CORE_ADDR *entry_p)
{
- if (symfile_objfile == NULL || !symfile_objfile->ei.entry_point_p)
+ if (symfile_objfile == NULL || !symfile_objfile->per_bfd->ei.entry_point_p)
return 0;
- *entry_p = (symfile_objfile->ei.entry_point
+ *entry_p = (symfile_objfile->per_bfd->ei.entry_point
+ ANOFFSET (symfile_objfile->section_offsets,
- symfile_objfile->ei.the_bfd_section_index));
+ symfile_objfile->per_bfd->ei.the_bfd_section_index));
return 1;
}