* minsyms.c (install_minimal_symbols): Move dropping leading

char from linkage name from here...
	(prim_record_minimal_symbol_and_info): ...to here.  Simplify
	test for "__gnu_compiled*" symbols.
This commit is contained in:
Corinna Vinschen 2004-03-29 11:26:04 +00:00
parent e802b91571
commit 66337bb10d
2 changed files with 24 additions and 28 deletions

View file

@ -1,3 +1,10 @@
2004-03-29 Corinna Vinschen <vinschen@redhat.com>
* minsyms.c (install_minimal_symbols): Move dropping leading
char from linkage name from here...
(prim_record_minimal_symbol_and_info): ...to here. Simplify
test for "__gnu_compiled*" symbols.
2004-03-28 Jim Blandy <jimb@redhat.com> 2004-03-28 Jim Blandy <jimb@redhat.com>
* rs6000-tdep.c (skip_prologue): Recognize moves from argument * rs6000-tdep.c (skip_prologue): Recognize moves from argument

View file

@ -580,26 +580,23 @@ prim_record_minimal_symbol_and_info (const char *name, CORE_ADDR address,
struct msym_bunch *new; struct msym_bunch *new;
struct minimal_symbol *msymbol; struct minimal_symbol *msymbol;
if (ms_type == mst_file_text)
{
/* Don't put gcc_compiled, __gnu_compiled_cplus, and friends into /* Don't put gcc_compiled, __gnu_compiled_cplus, and friends into
the minimal symbols, because if there is also another symbol the minimal symbols, because if there is also another symbol
at the same address (e.g. the first function of the file), at the same address (e.g. the first function of the file),
lookup_minimal_symbol_by_pc would have no way of getting the lookup_minimal_symbol_by_pc would have no way of getting the
right one. */ right one. */
if (name[0] == 'g' if (ms_type == mst_file_text && name[0] == 'g'
&& (strcmp (name, GCC_COMPILED_FLAG_SYMBOL) == 0 && (strcmp (name, GCC_COMPILED_FLAG_SYMBOL) == 0
|| strcmp (name, GCC2_COMPILED_FLAG_SYMBOL) == 0)) || strcmp (name, GCC2_COMPILED_FLAG_SYMBOL) == 0))
return (NULL); return (NULL);
{ /* It's safe to strip the leading char here once, since the name
const char *tempstring = name; is also stored stripped in the minimal symbol table. */
if (tempstring[0] == get_symbol_leading_char (objfile->obfd)) if (name[0] == get_symbol_leading_char (objfile->obfd))
++tempstring; ++name;
if (strncmp (tempstring, "__gnu_compiled", 14) == 0)
if (ms_type == mst_file_text && strncmp (name, "__gnu_compiled", 14) == 0)
return (NULL); return (NULL);
}
}
if (msym_bunch_index == BUNCH_SIZE) if (msym_bunch_index == BUNCH_SIZE)
{ {
@ -831,7 +828,6 @@ install_minimal_symbols (struct objfile *objfile)
struct msym_bunch *bunch; struct msym_bunch *bunch;
struct minimal_symbol *msymbols; struct minimal_symbol *msymbols;
int alloc_count; int alloc_count;
char leading_char;
if (msym_count > 0) if (msym_count > 0)
{ {
@ -859,18 +855,11 @@ install_minimal_symbols (struct objfile *objfile)
each bunch is full. */ each bunch is full. */
mcount = objfile->minimal_symbol_count; mcount = objfile->minimal_symbol_count;
leading_char = get_symbol_leading_char (objfile->obfd);
for (bunch = msym_bunch; bunch != NULL; bunch = bunch->next) for (bunch = msym_bunch; bunch != NULL; bunch = bunch->next)
{ {
for (bindex = 0; bindex < msym_bunch_index; bindex++, mcount++) for (bindex = 0; bindex < msym_bunch_index; bindex++, mcount++)
{
msymbols[mcount] = bunch->contents[bindex]; msymbols[mcount] = bunch->contents[bindex];
if (SYMBOL_LINKAGE_NAME (&msymbols[mcount])[0] == leading_char)
{
SYMBOL_LINKAGE_NAME (&msymbols[mcount])++;
}
}
msym_bunch_index = BUNCH_SIZE; msym_bunch_index = BUNCH_SIZE;
} }