Export the previously static symbol_name_count() function, which

returns a count of symbols with the same name.  Export a new
is_symbol_text() function, which checks whether specified symbol
entry is a type 't' or 'T'.
(atomlin@redhat.com, anderson@redhat.com)
This commit is contained in:
Dave Anderson 2015-07-09 12:56:29 -04:00
parent a8921b155f
commit 21874fe737
3 changed files with 12 additions and 8 deletions

2
defs.h
View File

@ -4546,6 +4546,7 @@ int is_kernel_text(ulong);
int is_kernel_data(ulong);
int is_init_data(ulong value);
int is_kernel_text_offset(ulong);
int is_symbol_text(struct syment *);
int is_rodata(ulong, struct syment **);
void datatype_init(void);
struct syment *symbol_search(char *);
@ -4569,6 +4570,7 @@ void show_symbol(struct syment *, ulong, ulong);
#define SHOW_DEC_OFFS (0x8)
#define SHOW_RADIX() (*gdb_output_radix == 16 ? SHOW_HEX_OFFS : SHOW_DEC_OFFS)
#define SHOW_MODULE (0x10)
int symbol_name_count(char *);
int symbol_query(char *, char *, struct syment **);
struct syment *next_symbol(char *, struct syment *);
struct syment *prev_symbol(char *, struct syment *);

View File

@ -2068,7 +2068,7 @@ ppc64_get_dumpfile_stack_frame(struct bt_info *bt_in, ulong *nip, ulong *ksp)
* platform_freeze_cpu() function.
*/
if ((sp = symbol_search("dump_header")) &&
!((sp->type == 'T') || (sp->type == 't'))) { /* Diskdump */
!is_symbol_text(sp)) { /* Diskdump */
ulong task_addr;
/*
* The dump_header struct is specified in the module.

View File

@ -37,7 +37,6 @@ static asection *get_kernel_section(char *);
static char * get_section(ulong vaddr, char *buf);
static void symbol_dump(ulong, char *);
static void check_for_dups(struct load_module *);
static int symbol_name_count(char *);
static struct syment *kallsyms_module_symbol(struct load_module *, symbol_info *);
static void store_load_module_symbols \
(bfd *, int, void *, long, uint, ulong, char *);
@ -2691,12 +2690,11 @@ is_kernel_text(ulong value)
start = 0;
if (pc->flags & SYSMAP) {
if ((sp = value_search(value, NULL)) &&
((sp->type == 'T') || (sp->type == 't')))
if ((sp = value_search(value, NULL)) && is_symbol_text(sp))
return TRUE;
for (sp = st->symtable; sp < st->symend; sp++) {
if (!((sp->type == 'T') || (sp->type == 't')))
if (!is_symbol_text(sp))
continue;
if ((value >= sp->value) && (value < kt->etext))
return TRUE;
@ -2718,8 +2716,7 @@ is_kernel_text(ulong value)
}
}
if ((sp = value_search(value, NULL)) &&
((sp->type == 'T') || (sp->type == 't')))
if ((sp = value_search(value, NULL)) && is_symbol_text(sp))
return TRUE;
if (NO_MODULES())
@ -2787,6 +2784,11 @@ is_kernel_text_offset(ulong value)
return(offset ? TRUE : FALSE);
}
int
is_symbol_text(struct syment *sp)
{
return ((sp->type == 'T') || (sp->type == 't'));
}
/*
* Check whether an address is most likely kernel data.
@ -4161,7 +4163,7 @@ symbol_search(char *s)
/*
* Count the number of instances of a symbol name.
*/
static int
int
symbol_name_count(char *s)
{
int i;