Re: Getting to the Symbol/String table
Re: Getting to the Symbol/String table
- Subject: Re: Getting to the Symbol/String table
- From: Jean-Daniel Dupas <email@hidden>
- Date: Fri, 7 Nov 2008 14:51:09 +0100
Le 7 nov. 08 à 13:25, Rohitash a écrit :
Hi,
I want to be able to find a symbol given an address .
I guess using atos (man atos for details) is not an option ?
For that, I would like to know how do I go to the begining of the
symbol/string table present in the __LINKEDIT section.
I can parse through the headers and reach to the LC_SYMTAB segment
and the __LINKEDIT segment . From here on , how can I use the below
values ( including the slide amount ) to get the base of the symbol
table and the string table ( so that I can scan through the lists to
find my symbol ) :
symtab_command.symoff - An integer containing the byte offset from
the start of the file to the location of the symbol table entries.
symtab_command.stroff - An integer containing the byte offset from
the start of the image to the location of the string table.
My logic goes as below :
1 . Get the count of the images _dyld_image_count and loop through
it and get the emage headers through _dyld_get_image_header() .
2 . Check for symtab/linkedit segments and store their addressess
accordingly.
A couple of more questions :
1. I wanted to know the actual reasoning for the slide amount which
I get through _dyld_get_image_vmaddr_slide() .
2. dlsym() complains of _start/start as not a valid symbol even
though I can see it from the o/p of the nm command.
Thanks.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden