+private:
+
+ /* The only way to create an objfile is to call objfile::make. */
+ objfile (bfd *, const char *, objfile_flags);
+
+public:
+
+ /* Normally you should not call delete. Instead, call 'unlink' to
+ remove it from the program space's list. In some cases, you may
+ need to hold a reference to an objfile that is independent of its
+ existence on the program space's list; for this case, the
+ destructor must be public so that shared_ptr can reference
+ it. */
+ ~objfile ();
+
+ /* Create an objfile. */
+ static objfile *make (bfd *bfd_, const char *name_, objfile_flags flags_,
+ objfile *parent = nullptr);
+
+ /* Remove an objfile from the current program space, and free
+ it. */
+ void unlink ();
+
+ DISABLE_COPY_AND_ASSIGN (objfile);
+
+ /* A range adapter that makes it possible to iterate over all
+ psymtabs in one objfile. */
+
+ psymtab_storage::partial_symtab_range psymtabs ()
+ {
+ return partial_symtabs->range ();
+ }
+
+ /* Reset the storage for the partial symbol tables. */
+
+ void reset_psymtabs ()
+ {
+ psymbol_map.clear ();
+ partial_symtabs.reset (new psymtab_storage ());
+ }
+
+ typedef next_adapter<struct compunit_symtab> compunits_range;
+
+ /* A range adapter that makes it possible to iterate over all
+ compunits in one objfile. */
+
+ compunits_range compunits ()
+ {
+ return compunits_range (compunit_symtabs);
+ }
+
+ /* A range adapter that makes it possible to iterate over all
+ minimal symbols of an objfile. */
+
+ class msymbols_range
+ {
+ public:
+
+ explicit msymbols_range (struct objfile *objfile)
+ : m_objfile (objfile)
+ {
+ }
+
+ minimal_symbol_iterator begin () const
+ {
+ return minimal_symbol_iterator (m_objfile->per_bfd->msymbols.get ());
+ }
+
+ minimal_symbol_iterator end () const
+ {
+ return minimal_symbol_iterator
+ (m_objfile->per_bfd->msymbols.get ()
+ + m_objfile->per_bfd->minimal_symbol_count);
+ }
+
+ private:
+
+ struct objfile *m_objfile;
+ };
+
+ /* Return a range adapter for iterating over all minimal
+ symbols. */
+
+ msymbols_range msymbols ()
+ {
+ return msymbols_range (this);
+ }
+
+ /* Return a range adapter for iterating over all the separate debug
+ objfiles of this objfile. */
+
+ separate_debug_range separate_debug_objfiles ()
+ {
+ return separate_debug_range (this);
+ }