minimal_symbol::value_address (objfile *objfile) const
{
if (this->maybe_copied (objfile))
- return get_msymbol_address (objfile, this);
+ return this->get_maybe_copied_address (objfile);
else
return (CORE_ADDR (this->unrelocated_address ())
+ objfile->section_offsets[this->section_index ()]);
/* See symtab.h. */
CORE_ADDR
-get_msymbol_address (struct objfile *objf, const struct minimal_symbol *minsym)
+minimal_symbol::get_maybe_copied_address (objfile *objf) const
{
- gdb_assert (minsym->maybe_copied (objf));
+ gdb_assert (this->maybe_copied (objf));
gdb_assert ((objf->flags & OBJF_MAINLINE) == 0);
- const char *linkage_name = minsym->linkage_name ();
+ const char *linkage_name = this->linkage_name ();
bound_minimal_symbol found = lookup_minimal_symbol_linkage (linkage_name,
true);
if (found.minsym != nullptr)
return found.value_address ();
- return (minsym->m_value.address
- + objf->section_offsets[minsym->section_index ()]);
+ return (this->m_value.address
+ + objf->section_offsets[this->section_index ()]);
}
\f
#define MINSYM_TYPE_BITS 4
gdb_static_assert (nr_minsym_types <= (1 << MINSYM_TYPE_BITS));
-/* Return the address of MINSYM, which comes from OBJF. The
- MAYBE_COPIED flag must be set on MINSYM. If MINSYM appears in the
- main program's minimal symbols, then that minsym's address is
- returned; otherwise, MINSYM's address is returned. This should
- generally only be used via the MSYMBOL_VALUE_ADDRESS macro. */
-
-extern CORE_ADDR get_msymbol_address (struct objfile *objf,
- const struct minimal_symbol *minsym);
-
/* Define a simple structure used to hold some very basic information about
all defined global symbols (text, data, bss, abs, etc). The only required
information is the general_symbol_info.
address in this symbol is used. */
bool maybe_copied (objfile *objfile) const;
+
+private:
+ /* Return the address of this minimal symbol, in the context of OBJF. The
+ MAYBE_COPIED flag must be set. If the minimal symbol appears in the
+ main program's minimal symbols, then that minsym's address is
+ returned; otherwise, this minimal symbol's address is returned. */
+ CORE_ADDR get_maybe_copied_address (objfile *objf) const;
};
#include "minsyms.h"