mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
Don't store the size of the symbol. (elf_parser_lookup_symbol): Look it up
Fri Feb 9 16:16:34 2007 Søren Sandmann <sandmann@redhat.com> * elfparser.c (struct ElfSym): Don't store the size of the symbol. (elf_parser_lookup_symbol): Look it up here instaed. * binfile.c (bin_file_free): Use pre-decrement instead of post-decrement. (bin_file_check_inode): Clarify the warning a little svn path=/trunk/; revision=349
This commit is contained in:
committed by
Søren Sandmann Pedersen
parent
e8c2a59906
commit
c1025c6b44
17
elfparser.c
17
elfparser.c
@ -11,7 +11,6 @@ struct ElfSym
|
||||
{
|
||||
gulong offset;
|
||||
gulong address;
|
||||
gulong size;
|
||||
};
|
||||
|
||||
struct Section
|
||||
@ -381,8 +380,6 @@ read_table (ElfParser *parser,
|
||||
{
|
||||
parser->symbols[n_functions].address = addr;
|
||||
parser->symbols[n_functions].offset = offset;
|
||||
parser->symbols[n_functions].size =
|
||||
bin_record_get_uint (symbol, "st_size");
|
||||
|
||||
n_functions++;
|
||||
}
|
||||
@ -485,9 +482,19 @@ elf_parser_lookup_symbol (ElfParser *parser,
|
||||
}
|
||||
#endif
|
||||
|
||||
if (result && result->address + result->size <= address)
|
||||
result = NULL;
|
||||
if (result)
|
||||
{
|
||||
gulong size;
|
||||
BinRecord *record;
|
||||
|
||||
record = bin_parser_get_record (parser->parser, parser->sym_format, result->offset);
|
||||
size = bin_record_get_uint (record, "st_size");
|
||||
bin_record_free (record);
|
||||
|
||||
if (result->address + size <= address)
|
||||
result = NULL;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user