mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
New function
2006-08-20 Soren Sandmann <sandmann@daimi.au.dk> * elfparser.c (elf_parser_new_from_file): New function
This commit is contained in:
committed by
Søren Sandmann Pedersen
parent
1b72901c4d
commit
7d8f3c232d
18
testelf.c
18
testelf.c
@ -33,16 +33,22 @@ check (ElfParser *elf, gulong addr)
|
||||
int
|
||||
main ()
|
||||
{
|
||||
GMappedFile *libgtk = g_mapped_file_new ("/usr/lib/libgtk-x11-2.0.so",
|
||||
FALSE, NULL);
|
||||
ElfParser *elf = elf_parser_new (
|
||||
g_mapped_file_get_contents (libgtk),
|
||||
g_mapped_file_get_length (libgtk));
|
||||
|
||||
ElfParser *elf;
|
||||
int i;
|
||||
|
||||
elf = elf_parser_new_from_file ("/usr/lib/libgtk-x11-2.0.so", NULL);
|
||||
|
||||
if (!elf)
|
||||
{
|
||||
g_print ("NO ELF!!!!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
elf_parser_get_crc32 (elf);
|
||||
|
||||
for (i = 0; i < 5000000; ++i)
|
||||
{
|
||||
elf_parser_get_crc32 (elf);
|
||||
check (elf, 0x077c80f0 - (0x07787000 - 0)); /* gtk_about_dialog_set_artists (add - (map - offset)) */
|
||||
|
||||
check (elf, 0x077c80f0 - (0x07787000 - 0)); /* same (but in the middle of the function */
|
||||
|
||||
Reference in New Issue
Block a user