move the entry point info into the per-bfd object

This moves the entry point information into the per-BFD object and
arranges not to recompute it when it has already been computed.

2014-01-15  Tom Tromey  <tromey@redhat.com>

	* symfile.c (init_entry_point_info): Use new "initialized" field.
	Update.
	* objfiles.h (struct entry_point) <initialized>: New field.
	(struct objfile_per_bfd_storage) <ei>: New field, moved from...
	(struct objfile) <ei>: ...here.  Remove.
	* objfiles.c (entry_point_address_query): Update.
This commit is contained in:
Tom Tromey
2013-12-31 06:57:18 -07:00
parent 53eddfa606
commit 6ef55de768
4 changed files with 36 additions and 18 deletions

View File

@@ -109,6 +109,9 @@ struct entry_info
/* Set to 1 iff ENTRY_POINT contains a valid value. */
unsigned entry_point_p : 1;
/* Set to 1 iff this object was initialized. */
unsigned initialized : 1;
};
/* Sections in an objfile. The section offsets are stored in the
@@ -195,6 +198,11 @@ struct objfile_per_bfd_storage
name, and the second is the demangled name or just a zero byte
if the name doesn't demangle. */
struct htab *demangled_names_hash;
/* The per-objfile information about the entry point, the scope (file/func)
containing the entry point, and the scope of the user's main() func. */
struct entry_info ei;
};
/* Master structure for keeping track of each file from which
@@ -318,11 +326,6 @@ struct objfile
const struct sym_fns *sf;
/* The per-objfile information about the entry point, the scope (file/func)
containing the entry point, and the scope of the user's main() func. */
struct entry_info ei;
/* Per objfile data-pointers required by other GDB modules. */
REGISTRY_FIELDS;