Getting to the Symbol/String table
Getting to the Symbol/String table
- Subject: Getting to the Symbol/String table
- From: Rohitash <email@hidden>
- Date: Fri, 07 Nov 2008 17:55:21 +0530
- Organization: Oracle Corporation
Hi,
I want to be able to find a symbol given an address . 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.
--
Disclaimer : The statements and opinions expressed here are my own and do not necessarily represent those of Oracle Corporation.
_______________________________________________
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