This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
rellocation address in .so
- From: Yannick PERRET <yperret at bat710 dot univ-lyon1 dot fr>
- To: binutils at sources dot redhat dot com
- Date: Thu, 21 Feb 2002 19:44:30 +0100
- Subject: rellocation address in .so
- Organization: UFR Info - Universite Claude Bernard Lyon1
Hi,
I can't figure how to know the effective address of
a function from a dynamic object.
I'm trying to extract names, files and lines for
each functions, known by its address (as given by
instrument-functions during execution).
For a program compiled with dynamic objects,
I can find the corresponding address in the sym-table
with the correct name by opening the exec.
But in this case (not a local function), I want to
test this address in each dynamic object linked with
the program. The problem is that I don't know how to
convert the program space address of the function
into the shared object address space to access it.
For example a function '_f4' is at 0x8048684 in
the program, and in the lib:
0x490 _f4
with a vma equal to 0x490 -> address '0x0'
The lib containing this function is supposed to be at
address 0x4001d000 (given by ldd and <link.h>)
libsimple_test_lib2.so => libsimple_test_lib2.so (0x4001d000)
I cannot figure how to convert 0x8048684 into 0x0.
Can you help me ?
Perhaps I do this the wrong way ?
Thank you for any help.
Regards,
--
Yannick