* symtab.h (struct minimal_symbol): Add size.
* dbxread.c: Use it.
* elfread.c: (record_minimal_symbol_and_info): Do not use info.
Rename to record_minimal_symbol.
(elf_symtab_read): Set MSYMBOL_SIZE explicitly.
* minsyms.c (prim_record_minimal_symbol_and_info): Initialize MSYMBOL_SIZE.
(install_minimal_symbols): Ditto.
* objfiles.c (terminate_minimal_symbol_table): Ditto.
* arm-tdep.c: Delete unused MSYMBOL_SIZE.
* m68hc11-tdep.c: Ditto.
* mips-tdep.c: Ditto.
* sh64-tdep.c: Ditto.
+2003-11-07 Michael Chastain <mec@shout.net>
+
+ * symtab.h (struct minimal_symbol): Add size.
+ * dbxread.c: Use it.
+ * elfread.c: (record_minimal_symbol_and_info): Do not use info.
+ Rename to record_minimal_symbol.
+ (elf_symtab_read): Set MSYMBOL_SIZE explicitly.
+ * minsyms.c (prim_record_minimal_symbol_and_info): Initialize MSYMBOL_SIZE.
+ (install_minimal_symbols): Ditto.
+ * objfiles.c (terminate_minimal_symbol_table): Ditto.
+ * arm-tdep.c: Delete unused MSYMBOL_SIZE.
+ * m68hc11-tdep.c: Ditto.
+ * mips-tdep.c: Ditto.
+ * sh64-tdep.c: Ditto.
+
2003-11-10 Michael Chastain <mec.gnu@mindspring.com>
* MAINTAINERS: Change my e-mail address.
/* Macros for setting and testing a bit in a minimal symbol that marks
it as Thumb function. The MSB of the minimal symbol's "info" field
- is used for this purpose. This field is already being used to store
- the symbol size, so the assumption is that the symbol size cannot
- exceed 2^31.
+ is used for this purpose.
MSYMBOL_SET_SPECIAL Actually sets the "special" bit.
- MSYMBOL_IS_SPECIAL Tests the "special" bit in a minimal symbol.
- MSYMBOL_SIZE Returns the size of the minimal symbol,
- i.e. the "info" field with the "special" bit
- masked out. */
+ MSYMBOL_IS_SPECIAL Tests the "special" bit in a minimal symbol. */
#define MSYMBOL_SET_SPECIAL(msym) \
MSYMBOL_INFO (msym) = (char *) (((long) MSYMBOL_INFO (msym)) \
#define MSYMBOL_IS_SPECIAL(msym) \
(((long) MSYMBOL_INFO (msym) & 0x80000000) != 0)
-#define MSYMBOL_SIZE(msym) \
- ((long) MSYMBOL_INFO (msym) & 0x7fffffff)
-
/* The list of available "set arm ..." and "show arm ..." commands. */
static struct cmd_list_element *setarmcmdlist = NULL;
static struct cmd_list_element *showarmcmdlist = NULL;
#include "aout/stab_gnu.h" /* We always use GNU stabs, not native, now */
\f
-/* This macro returns the size field of a minimal symbol, which is normally
- stored in the "info" field. The macro can be overridden for specific
- targets (e.g. MIPS16) that use the info field for other purposes. */
-#ifndef MSYMBOL_SIZE
-#define MSYMBOL_SIZE(msym) ((long) MSYMBOL_INFO (msym))
-#endif
-
-
/* We put a pointer to this structure in the read_symtab_private field
of the psymtab. */
}
static struct minimal_symbol *
-record_minimal_symbol_and_info (char *name, CORE_ADDR address,
- enum minimal_symbol_type ms_type, char *info, /* FIXME, is this really char *? */
- asection *bfd_section, struct objfile *objfile)
+record_minimal_symbol (char *name, CORE_ADDR address,
+ enum minimal_symbol_type ms_type,
+ asection *bfd_section, struct objfile *objfile)
{
if (ms_type == mst_text || ms_type == mst_file_text)
address = SMASH_TEXT_ADDRESS (address);
return prim_record_minimal_symbol_and_info
- (name, address, ms_type, info, bfd_section->index, bfd_section, objfile);
+ (name, address, ms_type, NULL, bfd_section->index, bfd_section, objfile);
}
/*
char *filesymname = obsavestring ("", 0, &objfile->symbol_obstack);
#endif
struct dbx_symfile_info *dbx = objfile->sym_stab_info;
- unsigned long size;
int stripped = (bfd_get_symcount (objfile->obfd) == 0);
if (dynamic)
if (symaddr == 0)
continue;
symaddr += offset;
- msym = record_minimal_symbol_and_info
+ msym = record_minimal_symbol
((char *) sym->name, symaddr,
- mst_solib_trampoline, NULL, sym->section, objfile);
+ mst_solib_trampoline, sym->section, objfile);
#ifdef SOFUN_ADDRESS_MAYBE_MISSING
if (msym != NULL)
msym->filename = filesymname;
/* ms_type = mst_unknown; */
continue; /* Skip this symbol. */
}
- /* Pass symbol size field in via BFD. FIXME!!! */
- size = ((elf_symbol_type *) sym)->internal_elf_sym.st_size;
- msym = record_minimal_symbol_and_info
+ msym = record_minimal_symbol
((char *) sym->name, symaddr,
- ms_type, (void *) size, sym->section, objfile);
+ ms_type, sym->section, objfile);
+ if (msym)
+ {
+ /* Pass symbol size field in via BFD. FIXME!!! */
+ unsigned long size = ((elf_symbol_type *) sym)->internal_elf_sym.st_size;
+ MSYMBOL_SIZE(msym) = size;
+ }
#ifdef SOFUN_ADDRESS_MAYBE_MISSING
if (msym != NULL)
msym->filename = filesymname;
analysis to compute correct stack frame layout.
The MSB of the minimal symbol's "info" field is used for this purpose.
- This field is already being used to store the symbol size, so the
- assumption is that the symbol size cannot exceed 2^30.
MSYMBOL_SET_RTC Actually sets the "RTC" bit.
MSYMBOL_SET_RTI Actually sets the "RTI" bit.
MSYMBOL_IS_RTC Tests the "RTC" bit in a minimal symbol.
- MSYMBOL_IS_RTI Tests the "RTC" bit in a minimal symbol.
- MSYMBOL_SIZE Returns the size of the minimal symbol,
- i.e. the "info" field with the "special" bit
- masked out. */
+ MSYMBOL_IS_RTI Tests the "RTC" bit in a minimal symbol. */
#define MSYMBOL_SET_RTC(msym) \
MSYMBOL_INFO (msym) = (char *) (((long) MSYMBOL_INFO (msym)) \
#define MSYMBOL_IS_RTI(msym) \
(((long) MSYMBOL_INFO (msym) & 0x40000000) != 0)
-#define MSYMBOL_SIZE(msym) \
- ((long) MSYMBOL_INFO (msym) & 0x3fffffff)
-
enum insn_return_kind {
RETURN_RTS,
RETURN_RTC,
MSYMBOL_TYPE (msymbol) = ms_type;
/* FIXME: This info, if it remains, needs its own field. */
MSYMBOL_INFO (msymbol) = info; /* FIXME! */
+ MSYMBOL_SIZE (msymbol) = 0;
/* The hash pointers must be cleared! If they're not,
add_minsym_to_hash_table will NOT add this msymbol to the hash table. */
SYMBOL_LINKAGE_NAME (&msymbols[mcount]) = NULL;
SYMBOL_VALUE_ADDRESS (&msymbols[mcount]) = 0;
MSYMBOL_INFO (&msymbols[mcount]) = NULL;
+ MSYMBOL_SIZE (&msymbols[mcount]) = 0;
MSYMBOL_TYPE (&msymbols[mcount]) = mst_unknown;
SYMBOL_INIT_LANGUAGE_SPECIFIC (&msymbols[mcount], language_unknown);
/* Functions for setting and testing a bit in a minimal symbol that
marks it as 16-bit function. The MSB of the minimal symbol's
- "info" field is used for this purpose. This field is already
- being used to store the symbol size, so the assumption is
- that the symbol size cannot exceed 2^31.
+ "info" field is used for this purpose.
ELF_MAKE_MSYMBOL_SPECIAL tests whether an ELF symbol is "special",
i.e. refers to a 16-bit function, and sets a "special" bit in a
minimal symbol to mark it as a 16-bit function
- MSYMBOL_IS_SPECIAL tests the "special" bit in a minimal symbol
- MSYMBOL_SIZE returns the size of the minimal symbol, i.e.
- the "info" field with the "special" bit masked out */
+ MSYMBOL_IS_SPECIAL tests the "special" bit in a minimal symbol */
static void
mips_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym)
DEPRECATED_SYMBOL_NAME (m) = NULL;
SYMBOL_VALUE_ADDRESS (m) = 0;
MSYMBOL_INFO (m) = NULL;
+ MSYMBOL_SIZE (m) = 0;
MSYMBOL_TYPE (m) = mst_unknown;
SYMBOL_INIT_LANGUAGE_SPECIFIC (m, language_unknown);
}
/* Macros and functions for setting and testing a bit in a minimal
symbol that marks it as 32-bit function. The MSB of the minimal
- symbol's "info" field is used for this purpose. This field is
- already being used to store the symbol size, so the assumption is
- that the symbol size cannot exceed 2^31.
+ symbol's "info" field is used for this purpose.
ELF_MAKE_MSYMBOL_SPECIAL
tests whether an ELF symbol is "special", i.e. refers
to a 32-bit function, and sets a "special" bit in a
minimal symbol to mark it as a 32-bit function
- MSYMBOL_IS_SPECIAL tests the "special" bit in a minimal symbol
- MSYMBOL_SIZE returns the size of the minimal symbol, i.e.
- the "info" field with the "special" bit masked out */
+ MSYMBOL_IS_SPECIAL tests the "special" bit in a minimal symbol */
#define MSYMBOL_IS_SPECIAL(msym) \
(((long) MSYMBOL_INFO (msym) & 0x80000000) != 0)
char *info;
+ /* Size of this symbol. end_psymtab in dbxread.c uses this
+ information to calculate the end of the partial symtab based on the
+ address of the last symbol plus the size of the last symbol. */
+
+ unsigned long size;
+
#ifdef SOFUN_ADDRESS_MAYBE_MISSING
/* Which source file is this symbol in? Only relevant for mst_file_*. */
char *filename;
};
#define MSYMBOL_INFO(msymbol) (msymbol)->info
+#define MSYMBOL_SIZE(msymbol) (msymbol)->size
#define MSYMBOL_TYPE(msymbol) (msymbol)->type
\f